nose-devs/nose — Issue #168: Error in testcase shows issubclass() arg... instead of 'real' error message
Author: jpellerin
Created: 2011-12-14 16:02:31+00:00
State: open

Hello,

I'm using a xmlrpc lib (not the python standard lib) for testing.

However, this library can throw an error like the following:
import xmlrpc

def test_00100():
"""server not available"""
server = xmlrpc.client("111.222.333.444", 9999)
server.execute("not_existing_function", [])

test_00100()

Traceback (most recent call last):
File "", line 11, in
File "", line 9, in test_00100
File "C:\Python26\lib\site-packages\xmlrpc.py", line 217, in execute
return self._o.execute(method, params, timeout, name, passw)
xmlrpc.error: (2, 'No such file or directory')

If I use the same code in a nose test, I get the following error:
import nose
from nose.tools import *

def test_00100():
"""server not available"""
server = xmlrpc.client("111.222.333.444", 9999)
server.execute("not_existing_function", [])

if __name__ == "__main__":
nose.runmodule()

Traceback (most recent call last):
File "C:\Python26\lib\site-packages\nose-0.11.3-py2.6.egg\nose\case.py", line 132, in run
self.runTest(result)
File "C:\Python26\lib\site-packages\nose-0.11.3-py2.6.egg\nose\case.py", line 150, in runTest
test(result)
File "C:\Python26\lib\unittest.py", line 300, in __call__
return self.run(*args, **kwds)
File "C:\Python26\lib\unittest.py", line 286, in run
result.addError(self, self._exc_info())
File "C:\Python26\lib\site-packages\nose-0.11.3-py2.6.egg\nose\proxy.py", line 122, in addError
self.result.addError(self.test, err)
File "C:\Python26\lib\site-packages\nose-0.11.3-py2.6.egg\nose\result.py", line 64, in addError
exc_info = self._exc_info_to_string(err)
File "C:\Python26\lib\site-packages\nose-0.11.3-py2.6.egg\nose\result.py", line 177, in _exc_info_to_string
if issubclass(err[0], SkipTest):
TypeError: issubclass() arg 1 must be a class

which doesn't point out the original error.

Google Code Info:
Issue #: 349
Author: mproel...@gmail.com
Created On: 2010-06-29T06:48:44.000Z
Closed On: