We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c25b0d commit 7c04da3Copy full SHA for 7c04da3
cuda_bindings/tests/test_graphics_apis.py
@@ -6,9 +6,15 @@
6
7
8
def test_graphics_api_smoketest():
9
- pyglet = pytest.importorskip("pyglet")
10
-
11
- tex = pyglet.image.Texture.create(512, 512)
+ # Due to lazy importing in pyglet, pytest.importorskip doesn't work
+ try:
+ import pyglet
12
+
13
+ tex = pyglet.image.Texture.create(512, 512)
14
+ except ImportError:
15
+ pytest.skip("pyglet not available or could not create GL context")
16
+ # return to make linters happy
17
+ return
18
19
err, gfx_resource = cudart.cudaGraphicsGLRegisterImage(
20
tex.id, tex.target, cudart.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsWriteDiscard
0 commit comments