Skip to content

Commit 7c04da3

Browse files
committed
Fix test
1 parent 4c25b0d commit 7c04da3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cuda_bindings/tests/test_graphics_apis.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66

77

88
def test_graphics_api_smoketest():
9-
pyglet = pytest.importorskip("pyglet")
10-
11-
tex = pyglet.image.Texture.create(512, 512)
9+
# Due to lazy importing in pyglet, pytest.importorskip doesn't work
10+
try:
11+
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
1218

1319
err, gfx_resource = cudart.cudaGraphicsGLRegisterImage(
1420
tex.id, tex.target, cudart.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsWriteDiscard

0 commit comments

Comments
 (0)