diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2016-07-25 17:29:26 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2016-08-05 10:45:04 -0700 |
commit | 045d1c4143c529960477621262ecb2ed15f477c3 (patch) | |
tree | 421fc6f8fba269972c4fdba66c61573e5dda6b98 /unittests | |
parent | 02a56e804fb08078abc8317f1aed126dda2bcaf1 (diff) |
unittests: port test_lists to pytest
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/suites/__init__.py | 0 | ||||
-rw-r--r-- | unittests/suites/test_native.py (renamed from unittests/test_lists.py) | 48 |
2 files changed, 24 insertions, 24 deletions
diff --git a/unittests/suites/__init__.py b/unittests/suites/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/unittests/suites/__init__.py diff --git a/unittests/test_lists.py b/unittests/suites/test_native.py index 7707e6478..6055bf664 100644 --- a/unittests/test_lists.py +++ b/unittests/suites/test_native.py @@ -30,27 +30,27 @@ from __future__ import ( absolute_import, division, print_function, unicode_literals ) import importlib -import os.path as path - -from nose.plugins.skip import SkipTest - -from . import utils - - -@utils.nose.generator -def gen_test_import(): - """ Generates a bunch of tests to import the various test modules """ - def check_import(module): - """ Test that a module can be imported """ - if not path.exists('bin'): - raise SkipTest( - "Piglit has not been compiled, this test will not work") - - importlib.import_module(module) - - # Test the various OpenGL modules - for module in ['all', 'quick', 'gpu', 'sanity', 'cpu', 'llvmpipe', 'cl', - 'quick_cl', 'shader', 'glslparser']: - check_import.description = \ - "tests.{}: Can be successfully imported".format(module) - yield check_import, "tests." + module +import os.path + +import pytest + +MODULES = [ + 'all', + pytest.mark.skipif(not os.path.exists('generated_tests/cl/builtin'), + reason='Requires that CL functionality is built')('cl'), + 'cpu', + 'glslparser', + 'gpu', + 'llvmpipe', + 'quick', + 'shader', +] + + +@pytest.mark.parametrize('name', MODULES) +@pytest.mark.skipif(not os.path.exists('bin'), + reason='This test requires the C layer to be built.') +def test_import(name): + """Test that each built-in module can be imported.""" + + importlib.import_module('tests.{}'.format(name)) |