diff options
author | Zachary Ware <zachary.ware@gmail.com> | 2014-07-23 17:00:29 (GMT) |
---|---|---|
committer | Zachary Ware <zachary.ware@gmail.com> | 2014-07-23 17:00:29 (GMT) |
commit | f012ba42fe54253378a2784aaf7177aa36be579a (patch) | |
tree | 44f904dd1023616f134f1e8f2cddac0185cd313e /Lib/test/test_tools | |
parent | c4c464911ab6a65a32b8b2162aa4537003efb87b (diff) | |
download | cpython-f012ba42fe54253378a2784aaf7177aa36be579a.zip cpython-f012ba42fe54253378a2784aaf7177aa36be579a.tar.gz cpython-f012ba42fe54253378a2784aaf7177aa36be579a.tar.bz2 |
Issue #22002: Make full use of test discovery in test sub-packages.
Adds `load_package_tests` function to test.support, uses it in test_asyncio,
test_email, test_json, test_tools, test_importlib and all test_importlib
sub-packages to implement test discovery.
Diffstat (limited to 'Lib/test/test_tools')
-rw-r--r-- | Lib/test/test_tools/__init__.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Lib/test/test_tools/__init__.py b/Lib/test/test_tools/__init__.py index 9b94cb4..04c8726 100644 --- a/Lib/test/test_tools/__init__.py +++ b/Lib/test/test_tools/__init__.py @@ -21,11 +21,5 @@ def import_tool(toolname): with support.DirsOnSysPath(scriptsdir): return importlib.import_module(toolname) -def load_tests(loader, standard_tests, pattern): - this_dir = os.path.dirname(__file__) - if pattern is None: - pattern = "test*" - with support.DirsOnSysPath(): - package_tests = loader.discover(start_dir=this_dir, pattern=pattern) - standard_tests.addTests(package_tests) - return standard_tests +def load_tests(*args): + return support.load_package_tests(os.path.dirname(__file__), *args) |