From 757676dc04a30fff5d21b8b4559b379249f8249e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Wed, 30 Oct 2024 16:45:30 +0100 Subject: [PATCH] Add OPENPMD_PYTHON_TEST_PREFIX environment variable (#1691) This makes it easier to select specific tests to run from Unittest.py --- test/python/unittest/Test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/python/unittest/Test.py b/test/python/unittest/Test.py index 081d9eabf7..b194f7d77e 100644 --- a/test/python/unittest/Test.py +++ b/test/python/unittest/Test.py @@ -15,8 +15,13 @@ # Define the test suite. def suite(): + test_loader = unittest.TestLoader() + env_name = "OPENPMD_PYTHON_TEST_PREFIX" + from os import environ + if env_name in environ: + test_loader.testMethodPrefix = environ[env_name] suites = [ - unittest.TestLoader().loadTestsFromTestCase(testCaseClass=APITest), + test_loader.loadTestsFromTestCase(testCaseClass=APITest), ] return unittest.TestSuite(suites)