[Python-checkins] cpython (2.7): Correction to issue 17052 fix

michael.foord python-checkins at python.org
Mon Feb 11 14:39:59 CET 2013


http://hg.python.org/cpython/rev/ece0a2e6b08e
changeset:   82154:ece0a2e6b08e
branch:      2.7
parent:      82149:1ccf0756a13d
user:        Michael Foord <michael at voidspace.org.uk>
date:        Mon Feb 11 12:53:21 2013 +0000
summary:
  Correction to issue 17052 fix

files:
  Lib/unittest/main.py                |  2 +-
  Lib/unittest/test/test_discovery.py |  2 +-
  Misc/NEWS                           |  2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py
--- a/Lib/unittest/main.py
+++ b/Lib/unittest/main.py
@@ -159,7 +159,7 @@
 
     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
--- a/Lib/unittest/test/test_discovery.py
+++ b/Lib/unittest/test/test_discovery.py
@@ -236,7 +236,7 @@
                 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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -202,7 +202,7 @@
 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.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list