[Python-checkins] python/dist/src/Lib unittest.py,1.36,1.37

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sat Dec 4 22:21:56 CET 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18262/lib

Modified Files:
	unittest.py 
Log Message:
SF bug #1078905: Docs for unittest run() methods are misleading



Index: unittest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/unittest.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- unittest.py	7 Nov 2004 15:46:25 -0000	1.36
+++ unittest.py	4 Dec 2004 21:21:53 -0000	1.37
@@ -277,7 +277,8 @@
         finally:
             result.stopTest(self)
 
-    __call__ = run
+    def __call__(self, *args, **kwds):
+        return self.run(*args, **kwds)
 
     def debug(self):
         """Run the test without collecting errors in a TestResult"""
@@ -417,15 +418,15 @@
             self.addTest(test)
 
     def run(self, result):
-        return self(result)
-
-    def __call__(self, result):
         for test in self._tests:
             if result.shouldStop:
                 break
             test(result)
         return result
 
+    def __call__(self, *args, **kwds):
+        return self.run(*args, **kwds)
+
     def debug(self):
         """Run the tests without collecting errors in a TestResult"""
         for test in self._tests: test.debug()



More information about the Python-checkins mailing list