-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
Description
Currently every test module in the distutils.tests package has function test_suite() which explicitly creates unittest.TestLoader and loads it by calling loadTestsFromTestCase() for every test class. Then test_main merges all these tests and runs them with test.support.run_unittest(). But test.support.run_unittest() will be removed (see #111165). Also, the distutils.tests package cannot be run via unittest, it does not search tests in submodules by default, and when run tests in submodules separately via unittest, it misses some doctests because they cannot be automatically loaded.
The following PR contains the following changes:
- use
unittest.main()instead ofrun_unittest(test_suite())to run tests from modules via the CLI - add explicit
load_tests()to load doctests - use
test.support.load_package_tests()to load tests in submodules ofdistutils.tests - removes no longer needed
test_suite()functions