mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
[3.12] gh-113267: Revert "gh-106584: Fix exit code for unittest in Python 3.12 (GH-106588)" (GH-114470) (GH-114994)
This reverts commit8fc071345b
. (cherry picked from commitecabff98c4
) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
d8a787258d
commit
0a737639dc
5 changed files with 14 additions and 16 deletions
|
@ -606,6 +606,7 @@ class TestCase(object):
|
|||
else:
|
||||
stopTestRun = None
|
||||
|
||||
result.startTest(self)
|
||||
try:
|
||||
testMethod = getattr(self, self._testMethodName)
|
||||
if (getattr(self.__class__, "__unittest_skip__", False) or
|
||||
|
@ -616,9 +617,6 @@ class TestCase(object):
|
|||
_addSkip(result, self, skip_why)
|
||||
return result
|
||||
|
||||
# Increase the number of tests only if it hasn't been skipped
|
||||
result.startTest(self)
|
||||
|
||||
expecting_failure = (
|
||||
getattr(self, "__unittest_expecting_failure__", False) or
|
||||
getattr(testMethod, "__unittest_expecting_failure__", False)
|
||||
|
|
|
@ -97,12 +97,10 @@ class TestResult(object):
|
|||
|
||||
sys.stdout = self._original_stdout
|
||||
sys.stderr = self._original_stderr
|
||||
if self._stdout_buffer is not None:
|
||||
self._stdout_buffer.seek(0)
|
||||
self._stdout_buffer.truncate()
|
||||
if self._stderr_buffer is not None:
|
||||
self._stderr_buffer.seek(0)
|
||||
self._stderr_buffer.truncate()
|
||||
self._stdout_buffer.seek(0)
|
||||
self._stdout_buffer.truncate()
|
||||
self._stderr_buffer.seek(0)
|
||||
self._stderr_buffer.truncate()
|
||||
|
||||
def stopTestRun(self):
|
||||
"""Called once after all tests are executed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue