summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2022-04-28 12:49:48 +0100
committerStephen Finucane <stephen@that.guru>2022-10-19 11:50:33 +0100
commit168f83c76119468948b6371cefec58d527c15510 (patch)
tree98972276e3e3a2e79620c473bc405d5a9ef80517
parentf0376a18496f2707f41a028882a500b83192b8d0 (diff)
downloadfixtures-git-168f83c76119468948b6371cefec58d527c15510.tar.gz
tests: Replace hardcoded list of test modules
Avoid this being an issue again the future. Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
-rw-r--r--fixtures/tests/_fixtures/__init__.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/fixtures/tests/_fixtures/__init__.py b/fixtures/tests/_fixtures/__init__.py
index b76244a..b2a33ef 100644
--- a/fixtures/tests/_fixtures/__init__.py
+++ b/fixtures/tests/_fixtures/__init__.py
@@ -13,23 +13,16 @@
# license you chose for the specific language governing permissions and
# limitations under that license.
+import os
+
+
def load_tests(loader, standard_tests, pattern):
test_modules = [
- 'environ',
- 'logger',
- 'mockpatch',
- 'monkeypatch',
- 'packagepath',
- 'popen',
- 'pythonpackage',
- 'pythonpath',
- 'streams',
- 'tempdir',
- 'temphomedir',
- 'timeout',
- 'warnings',
+ os.path.splitext(path)[0]
+ for path in os.listdir(os.path.dirname(__file__))
+ if path.startswith('test_')
]
- prefix = "fixtures.tests._fixtures.test_"
+ prefix = "fixtures.tests._fixtures."
test_mod_names = [prefix + test_module for test_module in test_modules]
standard_tests.addTests(loader.loadTestsFromNames(test_mod_names))
return standard_tests