nose-devs/nose — pull request #603 by saschpe (2013-01-18 10:27:45+00:00)
Title: Fix formatFailure expection if missing tb in exc_info

The FailureDetail plugin should not fail in formatFailure if no
traceback is in the exc_info tupple ('err' parameter). This happens,
e.g. when used with testtools:

Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/nose/case.py", line 133, in run
self.runTest(result)
File "/usr/lib64/python2.6/site-packages/nose/case.py", line 151, in runTest
test(result)
File "/usr/lib64/python2.6/unittest.py", line 300, in __call__
return self.run(*args, **kwds)
File "/usr/lib64/python2.6/site-packages/testtools/testcase.py", line 518, in run
return self.__RunTest(self, self.exception_handlers).run(result)
File "/usr/lib64/python2.6/site-packages/testtools/runtest.py", line 74, in run
return self._run_one(actual_result)
File "/usr/lib64/python2.6/site-packages/testtools/runtest.py", line 88, in _run_one
return self._run_prepared_result(ExtendedToOriginalDecorator(result))
File "/usr/lib64/python2.6/site-packages/testtools/runtest.py", line 107, in _run_prepared_result
handler(self.case, self.result, e)
File "/usr/lib64/python2.6/site-packages/testtools/testcase.py", line 494, in _report_failure
result.addFailure(self, details=self.getDetails())
File "/usr/lib64/python2.6/site-packages/testtools/testresult/real.py", line 605, in addFailure
return self.decorated.addFailure(test, err)
File "/usr/lib64/python2.6/site-packages/nose/proxy.py", line 146, in addFailure
formatted = plugins.formatFailure(self.test, err)
File "/usr/lib64/python2.6/site-packages/nose/plugins/manager.py", line 99, in __call__
return self.call(*arg, **kw)
File "/usr/lib64/python2.6/site-packages/nose/plugins/manager.py", line 141, in chain
result = meth(*arg, **kw)
File "/usr/lib64/python2.6/site-packages/nose/plugins/failuredetail.py", line 41, in formatFailure
tbinfo = inspect_traceback(tb)
File "/usr/lib64/python2.6/site-packages/nose/inspector.py", line 26, in inspect_traceback
while tb.tb_next:
AttributeError: 'NoneType' object has no attribute 'tb_next'