mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
remove uneeded function
This commit is contained in:
parent
2dc90fdfaf
commit
c9301355d8
1 changed files with 4 additions and 11 deletions
|
@ -373,14 +373,14 @@ class TestCase(object):
|
||||||
result.addSkip(self, str(e))
|
result.addSkip(self, str(e))
|
||||||
return
|
return
|
||||||
except Exception:
|
except Exception:
|
||||||
result.addError(self, self._exc_info())
|
result.addError(self, sys.exc_info())
|
||||||
return
|
return
|
||||||
|
|
||||||
success = False
|
success = False
|
||||||
try:
|
try:
|
||||||
testMethod()
|
testMethod()
|
||||||
except self.failureException:
|
except self.failureException:
|
||||||
result.addFailure(self, self._exc_info())
|
result.addFailure(self, sys.exc_info())
|
||||||
except _ExpectedFailure as e:
|
except _ExpectedFailure as e:
|
||||||
result.addExpectedFailure(self, e.exc_info)
|
result.addExpectedFailure(self, e.exc_info)
|
||||||
except _UnexpectedSuccess:
|
except _UnexpectedSuccess:
|
||||||
|
@ -388,14 +388,14 @@ class TestCase(object):
|
||||||
except SkipTest as e:
|
except SkipTest as e:
|
||||||
result.addSkip(self, str(e))
|
result.addSkip(self, str(e))
|
||||||
except Exception:
|
except Exception:
|
||||||
result.addError(self, self._exc_info())
|
result.addError(self, sys.exc_info())
|
||||||
else:
|
else:
|
||||||
success = True
|
success = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.tearDown()
|
self.tearDown()
|
||||||
except Exception:
|
except Exception:
|
||||||
result.addError(self, self._exc_info())
|
result.addError(self, sys.exc_info())
|
||||||
success = False
|
success = False
|
||||||
if success:
|
if success:
|
||||||
result.addSuccess(self)
|
result.addSuccess(self)
|
||||||
|
@ -411,13 +411,6 @@ class TestCase(object):
|
||||||
getattr(self, self._testMethodName)()
|
getattr(self, self._testMethodName)()
|
||||||
self.tearDown()
|
self.tearDown()
|
||||||
|
|
||||||
def _exc_info(self):
|
|
||||||
"""Return a version of sys.exc_info() with the traceback frame
|
|
||||||
minimised; usually the top level of the traceback frame is not
|
|
||||||
needed.
|
|
||||||
"""
|
|
||||||
return sys.exc_info()
|
|
||||||
|
|
||||||
def skip(self, reason):
|
def skip(self, reason):
|
||||||
"""Skip this test."""
|
"""Skip this test."""
|
||||||
raise SkipTest(reason)
|
raise SkipTest(reason)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue