Issue #22104: Don't hold a reference to the loaded TestSuite in runtest_inner
This commit is contained in:
parent
d577480197
commit
69fb6a41c5
|
@ -1273,8 +1273,10 @@ def runtest_inner(test, verbose, quiet,
|
||||||
# tests. If not, use normal unittest test loading.
|
# tests. If not, use normal unittest test loading.
|
||||||
test_runner = getattr(the_module, "test_main", None)
|
test_runner = getattr(the_module, "test_main", None)
|
||||||
if test_runner is None:
|
if test_runner is None:
|
||||||
tests = unittest.TestLoader().loadTestsFromModule(the_module)
|
def test_runner():
|
||||||
test_runner = lambda: support.run_unittest(tests)
|
loader = unittest.TestLoader()
|
||||||
|
tests = loader.loadTestsFromModule(the_module)
|
||||||
|
support.run_unittest(tests)
|
||||||
test_runner()
|
test_runner()
|
||||||
if huntrleaks:
|
if huntrleaks:
|
||||||
refleak = dash_R(the_module, test, test_runner, huntrleaks)
|
refleak = dash_R(the_module, test, test_runner, huntrleaks)
|
||||||
|
|
|
@ -239,6 +239,9 @@ IDLE
|
||||||
Tests
|
Tests
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Issue #22104: regrtest.py no longer holds a reference to the suite of tests
|
||||||
|
loaded from test modules that don't define test_main().
|
||||||
|
|
||||||
- Issue #22002: Added ``load_package_tests`` function to test.support and used
|
- Issue #22002: Added ``load_package_tests`` function to test.support and used
|
||||||
it to implement/augment test discovery in test_asyncio, test_email,
|
it to implement/augment test discovery in test_asyncio, test_email,
|
||||||
test_importlib, test_json, and test_tools.
|
test_importlib, test_json, and test_tools.
|
||||||
|
|
Loading…
Reference in New Issue