Skip to content

Commit

Permalink
Add OPENPMD_PYTHON_TEST_PREFIX environment variable
Browse files Browse the repository at this point in the history
This makes it easier to select specific tests to run from Unittest.py
  • Loading branch information
franzpoeschel committed Oct 30, 2024
1 parent 2593317 commit bb330bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/python/unittest/Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bb330bc

Please sign in to comment.