From 6c10265efd987eb6d5fdf6bd5a7b3c9d4f44881b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 2 May 2019 17:15:17 +0200 Subject: [PATCH] python: base for GL tests. --- src/python/magnum/test/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/python/magnum/test/__init__.py b/src/python/magnum/test/__init__.py index b61f69d..ce852ed 100644 --- a/src/python/magnum/test/__init__.py +++ b/src/python/magnum/test/__init__.py @@ -29,4 +29,18 @@ import unittest # TODO: do this differently / more robustly sys.path = [os.path.join(os.path.dirname(__file__), '../../../../build/src/python')] + sys.path + from magnum import * +from magnum import platform + +def setUpModule(): + if not hasattr(platform, 'WindowlessApplication'): # pragma: no cover + raise unittest.SkipTest('no WindowlessApplication found') + +class GLTestCase(unittest.TestCase): + app = None + + @classmethod + def setUpClass(cls): + if not GLTestCase.app: + GLTestCase.app = platform.WindowlessApplication()