nose-devs/nose — Issue #343: xunit output broken when ContextSuites have errors/failures
Author: jpellerin
Created: 2011-12-14 16:08:40+00:00
State: open

The xunit plugin assumes all failing tests have an id() function, which is
not true, for example, for ContextSuite instances.

For example, look at the following stack trace:
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/core.py", line
113, in __init__
argv=argv, testRunner=testRunner, testLoader=testLoader)
File "/usr/lib/python2.4/unittest.py", line 759, in __init__
self.runTests()
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/core.py", line
192, in runTests
result = self.testRunner.run(self.test)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/core.py", line
61, in run
test(result)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/suite.py",
line 154, in __call__
return self.run(*arg, **kw)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/suite.py",
line 197, in run
test(orig)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/suite.py",
line 154, in __call__
return self.run(*arg, **kw)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/suite.py",
line 197, in run
test(orig)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/suite.py",
line 154, in __call__
return self.run(*arg, **kw)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/suite.py",
line 197, in run
test(orig)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/suite.py",
line 154, in __call__
return self.run(*arg, **kw)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/suite.py",
line 197, in run
test(orig)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/suite.py",
line 154, in __call__
return self.run(*arg, **kw)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/suite.py",
line 187, in run
result.addError(self, self._exc_info())
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/proxy.py",
line 121, in addError
plugins.addError(self.test, err)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/plugins/manager.py",
line 82, in __call__
return self.call(*arg, **kw)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/plugins/manager.py",
line 150, in simple
result = meth(*arg, **kw)
File
"/usr/local/lib/python2.4/site-packages/nose-0.11.1-py2.4.egg/nose/plugins/xunit.py",
line 165, in addError
id = test.id()
AttributeError: 'ContextSuite' object has no attribute 'id'

Google Code Info:
Issue #: 286
Author: ne...@equinox.co.za
Created On: 2009-08-26T12:04:34.000Z
Closed On: 2009-08-26T14:05:23.000Z