mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
c4c464911a
commit
f012ba42fe
21 changed files with 104 additions and 169 deletions
|
@ -1,12 +1,5 @@
|
|||
from .. import test_suite
|
||||
import os
|
||||
from test.support import load_package_tests
|
||||
|
||||
|
||||
def test_suite():
|
||||
directory = os.path.dirname(__file__)
|
||||
return test_suite('importlib.test.builtin', directory)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from test.support import run_unittest
|
||||
run_unittest(test_suite())
|
||||
def load_tests(*args):
|
||||
return load_package_tests(os.path.dirname(__file__), *args)
|
||||
|
|
4
Lib/test/test_importlib/builtin/__main__.py
Normal file
4
Lib/test/test_importlib/builtin/__main__.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
from . import load_tests
|
||||
import unittest
|
||||
|
||||
unittest.main()
|
Loading…
Add table
Add a link
Reference in a new issue