PyDocs

Development Tools

test.regrtest

The test package can be run as a script to drive Python’s regression test suite, thanks to the -m option: python -m test. Under the hood, it uses test.regrtest; the call python -m test.regrtest used in previous Python versions still works. Running the script by itself automatically starts running all regression tests in the test package. It does this by finding modules and packages whose names start with test_, importing each one, and loading its tests with unittest.TestLoader.loadTestsFromModule(). See the load_tests protocol for how a module or package can customize what is loaded. Defining a module-level test_main() function is not supported and causes the test to fail. The names of tests to execute may also be passed to the script. Specifying a single regression test (python -m test test_spam) will minimize output and only print whether the test passed or failed.
Symbols in test.regrtest