nose-devs/nose — Issue #48: Confusing output encountered on 10.3 with Python 2.4.5 when exception caught in 
Author: jpellerin
Created: 2011-12-14 15:57:02+00:00
State: open

What steps will reproduce the problem?
1. Add an error to a package setup / teardown. Example:

# __init__.py:
def setupPackage():
foo=open ("some_file_that_doesn't_exist", "r")
# some_test.py:
def test():
pass

2. Execute the testcase:
nosetests some_test.py

What is the expected output? What do you see instead?
- An error related to the actual problem experienced when setting up the
package / module.
- A confusing Python exception:

[garrcoop@nova-nurburgring test_int2]$ nosetests some_test.py
Traceback (most recent call last):
File "/auto/nova/tools/latest/bin/nosetests", line 5, in ?
main()
File
"/ws/garrcoop/tools/python-2.4.5/i386-redhat-linux/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/core.py",
line 219, in __init__
argv=argv, testRunner=testRunner, testLoader=testLoader)
File "/nfs/nova/packages/i386/python/2.4.5/lib/python2.4/unittest.py",
line 759, in __init__
self.runTests()
File
"/ws/garrcoop/tools/python-2.4.5/i386-redhat-linux/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/core.py",
line 298, in runTests
result = self.testRunner.run(self.test)
File
"/ws/garrcoop/tools/python-2.4.5/i386-redhat-linux/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/core.py",
line 62, in run
test(result)
File
"/ws/garrcoop/tools/python-2.4.5/i386-redhat-linux/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/suite.py",
line 132, in __call__
return self.run(*arg, **kw)
File
"/ws/garrcoop/tools/python-2.4.5/i386-redhat-linux/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/suite.py",
line 152, in run
result.addError(self, self.exc_info())
File
"/ws/garrcoop/tools/python-2.4.5/i386-redhat-linux/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/proxy.py",
line 126, in addError
plugins.addError(self.test, err)
File
"/ws/garrcoop/tools/python-2.4.5/i386-redhat-linux/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/plugins/manager.py",
line 81, in __call__
return self.call(*arg, **kw)
File
"/ws/garrcoop/tools/python-2.4.5/i386-redhat-linux/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/plugins/manager.py",
line 145, in simple
result = meth(*arg, **kw)
File
"/ws/garrcoop/tools/python-2.4.5/i386-redhat-linux/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/plugins/manager.py",
line 301, in addError
return self.plugin.addError(test.test, err, capt)
AttributeError: 'ContextSuite' object has no attribute 'test'

What version of the product are you using? On what operating system?

Version: 0.10.3.
OS Version:
[garrcoop@nova-nurburgring test_int2]$ uname -a
Linux nova-nurburgring 2.6.9-67.0.7.ELsmp #1 SMP Wed Feb 27 04:48:20 EST
2008 i686 i686 i386 GNU/Linux
[garrcoop@nova-nurburgring test_int2]$ head -n 1 /etc/issue
Red Hat Enterprise Linux AS release 4 (Nahant Update 6)

Please provide any additional information below.

We have 2 custom plugins provided for nosetests, but this issue is
occurring with --with-isolation as well as without.

I've seen this issue occur when raising an IOError, TypeErrors, and a
variety of different errors, so maybe the problem is that fact that only
Exceptions are being caught and handled properly, not errors?

Inserting the following line in nose.proxy at line 120 helps identify the
actual issue:

print "DEBUG:",self.test,"ERROR:",err,"TYPE:",type(err)

Interestingly enough this doesn't occur on a FreeBSD system with a vanilla
nosetests 0.10.4 installed.

Google Code Info:
Issue #: 217
Author: yaneg...@gmail.com
Created On: 2008-11-03T02:28:44.000Z
Closed On: