]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Correction to issue 17052 fix
authorMichael Foord <michael@voidspace.org.uk>
Mon, 11 Feb 2013 13:20:52 +0000 (13:20 +0000)
committerMichael Foord <michael@voidspace.org.uk>
Mon, 11 Feb 2013 13:20:52 +0000 (13:20 +0000)
Lib/unittest/main.py
Lib/unittest/test/test_discovery.py
Misc/NEWS

index d09bccdf2c22c53d14a5485ab13ae91c3a7dabdb..63c813900054a65ff64879e7014b24749c9a7c39 100644 (file)
@@ -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
index eba269fc7a387c33b5218be825c1ba2276dbd341..1fdf9913c970436f089bcf6d83b335de5455970e 100644 (file)
@@ -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)])
 
index d6ac0e7d610d3b5aef071fd5fb29bca72315537e..1f772b724127564034f16b80f2b9a51c91c69260 100644 (file)
--- 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.