nose-devs/nose — Issue #411: Error in addFailure when handling a pymox exception
Author: jpellerin
Created: 2011-12-14 16:10:30+00:00
State: open

When using nose 1.0.0 (as well as trunk) I get the following nose error when my test fails due to a pymox exception:

======================================================================
ERROR: test_login (bamboo.tests.test_account_manager.TestAccountManager)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/skrul/dev/bamboo-env/lib/python2.6/site-packages/nose-1.0.1.dev-py2.6.egg/nose/case.py", line 133, in run
self.runTest(result)
File "/Users/skrul/dev/bamboo-env/lib/python2.6/site-packages/nose-1.0.1.dev-py2.6.egg/nose/case.py", line 151, in runTest
test(result)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py", line 300, in __call__
return self.run(*args, **kwds)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py", line 282, in run
result.addFailure(self, self._exc_info())
File "/Users/skrul/dev/bamboo-env/lib/python2.6/site-packages/nose-1.0.1.dev-py2.6.egg/nose/proxy.py", line 140, in addFailure
# err = (err[0], err[0](err[1]), err[2])
TypeError: __init__() takes exactly 3 arguments (2 given)
-------------------- >> begin captured logging << --------------------
pylons.configuration: DEBUG: Initializing configuration, package: 'bamboo'
routes.middleware: DEBUG: Initialized with method overriding = True, and path info altering = True
--------------------- >> end captured logging << ---------------------

In the debugger, err is:

(Pdb) print err
(, "Unexpected method call Service.get_profile() -> None\n>> raise UnexpectedMethodCallError(self, None)\n \n-------------------- >> begin captured logging << --------------------\npylons.configuration: DEBUG: Initializing configuration, package: 'bamboo'\nroutes.middleware: DEBUG: Initialized with method overriding = True, and path info altering = True\n--------------------- >> end captured logging << ---------------------", )

I am able to get this to work as it should by removing the two lines of code added to proxy.py in this change:

http://code.google.com/p/python-nose/source/detail?r=5469e307c15d0fecf3e661c3564e11e8a2320cdf

Google Code Info:
Issue #: 405
Author: skrulx
Created On: 2011-03-21T21:32:09.000Z
Closed On: 2011-03-22T15:06:57.000Z