nose-devs/nose — Issue #225: Nose exception hides a string exception.
Author: jpellerin
Created: 2011-12-14 16:04:18+00:00
State: open

In Python 2.3, with nose 0.10.0b1, when my test code raises a string
exception such as:

'raise "My exception"'

then nose generates an error with issubclass that doesn't show anything
about the location of my error, or that it was an exception object that was
expected. I'm not defending the string exception, and I've changed the
code to an exception object, but finding the error was non-trivial. A Nose
warning or more informative error would have been extremely useful.

======================================================================
ERROR: test_sphere_nodes
(encode.solver.acusolve.reader.tests.mesh_test_case.MeshTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/opt/enthought/enthon-2.3/lib/python2.3/site-packages/nose-0.10.0b1-py2.3.egg/nose/case.py",
line 142, in run
self.runTest(result)
File
"/opt/enthought/enthon-2.3/lib/python2.3/site-packages/nose-0.10.0b1-py2.3.egg/nose/case.py",
line 160, in runTest
test(result)
File
"/var/tmp/enthon-2.3-python2.3-2.3.5-root/opt/enthought/enthon-2.3/lib/python2.3/unittest.py",
line 224, in __call__
result.addError(self, self.__exc_info())
File
"/opt/enthought/enthon-2.3/lib/python2.3/site-packages/nose-0.10.0b1-py2.3.egg/nose/proxy.py",
line 108, in addError
plugins.addError(self.test, err)
File
"/opt/enthought/enthon-2.3/lib/python2.3/site-packages/nose-0.10.0b1-py2.3.egg/nose/plugins/manager.py",
line 79, in __call__
return self.call(*arg, **kw)
File
"/opt/enthought/enthon-2.3/lib/python2.3/site-packages/nose-0.10.0b1-py2.3.egg/nose/plugins/manager.py",
line 135, in simple
result = meth(*arg, **kw)
File
"/opt/enthought/enthon-2.3/lib/python2.3/site-packages/nose-0.10.0b1-py2.3.egg/nose/plugins/errorclass.py",
line 132, in addError
if filter(lambda c: issubclass(err_cls, c), classes):
File
"/opt/enthought/enthon-2.3/lib/python2.3/site-packages/nose-0.10.0b1-py2.3.egg/nose/plugins/errorclass.py",
line 132, in
if filter(lambda c: issubclass(err_cls, c), classes):
TypeError: issubclass() arg 1 must be a class

Google Code Info:
Issue #: 101
Author: depa...@gmail.com
Created On: 2007-09-21T17:47:46.000Z
Closed On: 2007-09-21T18:39:55.000Z