]> granicus.if.org Git - python/commitdiff
Correction to issue 17052 fix
authorMichael Foord <michael@voidspace.org.uk>
Mon, 11 Feb 2013 12:53:21 +0000 (12:53 +0000)
committerMichael Foord <michael@voidspace.org.uk>
Mon, 11 Feb 2013 12:53:21 +0000 (12:53 +0000)
Lib/unittest/main.py
Lib/unittest/test/test_discovery.py
Misc/NEWS

index 1e001a6a2605a01c5118ab4d3d5db10f4c0b6147..b25367992de8ac7e004c906d9b6a104f83dffb80 100644 (file)
@@ -159,7 +159,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 3dec2ee57e1da45ed6157018be6dac9ecd9b3c08..8c031a0034a846c6833e280f4af8ef7ad9c8fa39 100644 (file)
@@ -236,7 +236,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 d5186d3353b1d3db84c74a89b65caf671a232238..a65c0911e7dd8b37ff7eeaf7aac0cc6613a6bcee 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -202,7 +202,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.