From: Michael Foord Date: Mon, 11 Feb 2013 13:20:52 +0000 (+0000) Subject: Correction to issue 17052 fix X-Git-Tag: v3.2.4rc1~112 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f78f5b11f65ff6fd582d937615e8a1c3c8373662;p=thirdparty%2FPython%2Fcpython.git Correction to issue 17052 fix --- diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py index d09bccdf2c22..63c813900054 100644 --- a/Lib/unittest/main.py +++ b/Lib/unittest/main.py @@ -199,7 +199,7 @@ class TestProgram(object): def _do_discovery(self, argv, Loader=None): if Loader is None: - Loader = self.testLoader + Loader = lambda: self.testLoader # handle command line args for test discovery self.progName = '%s discover' % self.progName diff --git a/Lib/unittest/test/test_discovery.py b/Lib/unittest/test/test_discovery.py index eba269fc7a38..1fdf9913c970 100644 --- a/Lib/unittest/test/test_discovery.py +++ b/Lib/unittest/test/test_discovery.py @@ -269,7 +269,7 @@ class TestDiscovery(unittest.TestCase): self.args.append((start_dir, pattern, top_level_dir)) return 'tests' - program.testLoader = Loader + program.testLoader = Loader() program._do_discovery(['-v']) self.assertEqual(Loader.args, [('.', 'test*.py', None)]) diff --git a/Misc/NEWS b/Misc/NEWS index d6ac0e7d610d..1f772b724127 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -221,7 +221,7 @@ Core and Builtins Library ------- -- Issue #17502: unittest discovery should use self.testLoader. +- Issue #17052: unittest discovery should use self.testLoader. - Issue #17141: random.vonmisesvariate() no more hangs for large kappas.