fix compat with testcases from trial-11.1.0

This commit is contained in:
holger krekel 2011-11-18 16:34:46 +00:00
parent a5e7b2760d
commit 58e0301f87
2 changed files with 8 additions and 2 deletions

View File

@ -28,6 +28,7 @@ Changes between 2.1.3 and XXX 2.2.0
- fix and cleanup pytest's own test suite to not leak FDs
- fix issue83: link to generated funcarg list
- fix issue74: pyarg module names are now checked against imp.find_module false positives
- fix compatibility with twisted/trial-11.1.0 use cases
Changes between 2.1.2 and 2.1.3
----------------------------------------

View File

@ -120,14 +120,19 @@ def pytest_runtest_protocol(item, __multicall__):
ut = sys.modules['twisted.python.failure']
Failure__init__ = ut.Failure.__init__.im_func
check_testcase_implements_trial_reporter()
def excstore(self, exc_value=None, exc_type=None, exc_tb=None):
def excstore(self, exc_value=None, exc_type=None, exc_tb=None,
captureVars=None):
if exc_value is None:
self._rawexcinfo = sys.exc_info()
else:
if exc_type is None:
exc_type = type(exc_value)
self._rawexcinfo = (exc_type, exc_value, exc_tb)
Failure__init__(self, exc_value, exc_type, exc_tb)
try:
Failure__init__(self, exc_value, exc_type, exc_tb,
captureVars=captureVars)
except TypeError:
Failure__init__(self, exc_value, exc_type, exc_tb)
ut.Failure.__init__ = excstore
try:
return __multicall__.execute()