nose-devs/nose — Issue #382: formatFailure documentation says to return (test, err) but it really just wants return err
Author: jpellerin
Created: 2011-12-14 16:09:35+00:00
State: open

What steps will reproduce the problem?
1. make a plugin with a formatFailure
2. try to return what it suggests, (test, err)
3. install & test with a failing test case

What is the expected output? What do you see instead?
I expect to see the normal failure output and instead I see:
======================================================================

ERROR: test_twisted.test_fail

----------------------------------------------------------------------

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/nose/case.py", line 132, in run

self.runTest(result)

File "/usr/lib/python2.4/site-packages/nose/case.py", line 150, in runTest

test(result)

File "/usr/lib/python2.4/unittest.py", line 281, in __call__

return self.run(*args, **kwds)

File "/usr/lib/python2.4/unittest.py", line 263, in run

result.addFailure(self, self.__exc_info())

File "/usr/lib/python2.4/site-packages/nose/proxy.py", line 137, in addFailure

self.result.addFailure(self.test, err)

File "/usr/lib/python2.4/unittest.py", line 658, in addFailure

TestResult.addFailure(self, test, err)

File "/usr/lib/python2.4/unittest.py", line 129, in addFailure

self.failures.append((test, self._exc_info_to_string(err, test)))

File "/usr/lib/python2.4/site-packages/nose/result.py", line 184, in _exc_info_to_string

if issubclass(err[0], SkipTest):

TypeError: issubclass() arg 1 must be a class

This is because it's trying to use test as a class instead of exctype. returning err (which is a 3ple, the 0th of which is a class) works.

What version of the product are you using? On what operating system?
RHEL 5, nose 0.11.4 from hg.

Please provide any additional information below.

Google Code Info:
Issue #: 355
Author: xitr...@gmail.com
Created On: 2010-07-29T10:58:10.000Z
Closed On: