From fdf5671c4cb6d00854e7ebb54ce24fc820c116aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 15 Sep 2019 10:20:07 +0200 Subject: [PATCH] python: implicitly test for GL errors in all tests. --- src/python/magnum/test/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/python/magnum/test/__init__.py b/src/python/magnum/test/__init__.py index b0f85af..76000eb 100644 --- a/src/python/magnum/test/__init__.py +++ b/src/python/magnum/test/__init__.py @@ -31,7 +31,7 @@ import unittest sys.path = [os.path.join(os.path.dirname(__file__), os.environ.get('CMAKE_BINARY_DIR', '../../../../build'), 'src/python')] + sys.path from magnum import * -from magnum import platform +from magnum import gl, platform def setUpModule(): if os.environ.get('MAGNUM_SKIP_GL_TESTS') == 'ON': @@ -46,3 +46,12 @@ class GLTestCase(unittest.TestCase): def setUpClass(cls): if not GLTestCase.app: GLTestCase.app = platform.WindowlessApplication() + + def assertNoGLError(self): + self.assertEqual(gl.Renderer.error, gl.Renderer.Error.NO_ERROR) + + def setUp(self): + self.assertNoGLError() + + def tearDown(self): + self.assertNoGLError()