Skip to content

Commit caca6fe

Browse files
committed
skip opengl tests if opengl not present
1 parent 3c0e08a commit caca6fe

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/window_test.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,6 @@ def test_init_flags(self):
286286
self.assertTrue(win.resizable)
287287
win.destroy()
288288

289-
# test opengl
290-
win = Window(opengl=True)
291-
self.assertTrue(win.opengl)
292-
win.destroy()
293-
294289
# should raise a TypeError if keyword is random
295290
self.assertRaises(TypeError, lambda: Window(aaa=True))
296291
self.assertRaises(TypeError, lambda: Window(aaa=False))
@@ -380,6 +375,10 @@ def test_window_flip(self):
380375
)
381376
win.destroy()
382377

378+
@unittest.skipIf(
379+
os.environ.get("SDL_VIDEODRIVER") == pygame.NULL_VIDEODRIVER,
380+
"OpenGL requires a non-null SDL_VIDEODRIVER",
381+
)
383382
def test_window_opengl(self):
384383
win1 = Window(opengl=True)
385384
self.assertTrue(win1.opengl)

0 commit comments

Comments
 (0)