+`libregrtest` does not call `test_main()`. If the imported module defines it, `Lib/test/libregrtest/single.py` raises `Exception`. regrtest reports the module as failed with an uncaught exception (stderr: `test <name> crashed`; summary: `failed (uncaught exception)`). Tests are loaded with `loadTestsFromModule`, which collects `TestCase` classes and, when the module defines `load_tests`, runs the suite that function returns. Packages use `load_tests`, usually via `test.support.load_package_tests`, to add tests from submodules. `reap_children()` is called from `setUp()`, `tearDown()`, and `tearDownModule()`.
0 commit comments