From bb330bcb04c7e17f83041b94295d3c465360d0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Wed, 30 Oct 2024 15:30:14 +0100 Subject: [PATCH] Add OPENPMD_PYTHON_TEST_PREFIX environment variable 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)