summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2014-08-04 16:18:23 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2014-08-04 16:18:23 (GMT)
commit17c336284d3292a62a6ddcb4ffff4679ce717f6a (patch)
tree6aa6ff2192df2fc654440fbccd0f240e3b81055e
parentc734c387dee2f71f25e3dee0b2566f7eca960741 (diff)
parent69fb6a41c56a6a92f091108c1429d406cc8d0296 (diff)
downloadcpython-17c336284d3292a62a6ddcb4ffff4679ce717f6a.zip
cpython-17c336284d3292a62a6ddcb4ffff4679ce717f6a.tar.gz
cpython-17c336284d3292a62a6ddcb4ffff4679ce717f6a.tar.bz2
Closes #22104: Merge with 3.4
-rwxr-xr-xLib/test/regrtest.py6
-rw-r--r--Misc/NEWS3
2 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index c1c831f..b633631 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1273,8 +1273,10 @@ def runtest_inner(test, verbose, quiet,
# tests. If not, use normal unittest test loading.
test_runner = getattr(the_module, "test_main", None)
if test_runner is None:
- tests = unittest.TestLoader().loadTestsFromModule(the_module)
- test_runner = lambda: support.run_unittest(tests)
+ def test_runner():
+ loader = unittest.TestLoader()
+ tests = loader.loadTestsFromModule(the_module)
+ support.run_unittest(tests)
test_runner()
if huntrleaks:
refleak = dash_R(the_module, test, test_runner, huntrleaks)
diff --git a/Misc/NEWS b/Misc/NEWS
index 864f894..f914cad 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -802,6 +802,9 @@ Documentation
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 #22111: Assorted cleanups in test_imaplib. Patch by Milan Oberkirch.
- Issue #22002: Added ``load_package_tests`` function to test.support and used