mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
SF bug #1078905: Docs for unittest run() methods are misleading
This commit is contained in:
parent
46ea4c810f
commit
664347be94
2 changed files with 9 additions and 4 deletions
|
@ -277,7 +277,8 @@ class TestCase:
|
|||
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 @@ class TestSuite:
|
|||
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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue