nose-devs/nose — Issue #321: Nose isn't playing well with Mox on failures - OSX
Author: jpellerin
Created: 2011-12-14 16:07:44+00:00
State: closed

I'm not sure if this is a nose problem or a mox problem; but I thought I would share it in both
places.

The problem is the readability of the error. The error is being thrown because the mock isn't
matching, which is good. However, the error gives no clue as to what
failed. In OSX, I have no idea what mock getting the wrong data sent to it.

What steps will reproduce the problem?
1. Create a failing test that use mox
2. Run the tests with nose

What is the expected output? What do you see instead?
I expect to see output like:

===========================================================
===========
FAIL: test_failing_hello (mymodule_test.TestHello)
----------------------------------------------------------------------
Traceback (most recent call last):
File "build/bdist.linux-i686/egg/mox.py", line 1374, in new_method
func(self, *args, **kwargs)
File "/home/pope/Documents/code/gist-74723/mymodule_test.py", line 13, in
test_failing_hello
mymodule.hello()
File "/home/pope/Documents/code/gist-74723/mymodule.py", line 6, in hello
return repeater("Hello")
File "build/bdist.linux-i686/egg/mox.py", line 562, in __call__
expected_method = self._VerifyMethodCall()
File "build/bdist.linux-i686/egg/mox.py", line 608, in _VerifyMethodCall
raise UnexpectedMethodCallError(self, expected)
UnexpectedMethodCallError: Unexpected method call: __call__('Hello') -> None. Expecting:
__call__('World') -> 'HelloWorld'

----------------------------------------------------------------------

However, I am seeing this:

===========================================================
===========
ERROR: test_failing_hello (mymodule_test.TestHello)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/pope/Desktop/mox_test/nose-0.10.4-py2.6.egg/nose/case.py", line 131, in run
self.runTest(result)
File "/Users/pope/Desktop/mox_test/nose-0.10.4-py2.6.egg/nose/case.py", line 149, in
runTest
test(result)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py", line
300, in __call__
return self.run(*args, **kwds)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py", line
282, in run
result.addFailure(self, self._exc_info())
File "/Users/pope/Desktop/mox_test/nose-0.10.4-py2.6.egg/nose/proxy.py", line 131, in
addFailure
formatted = plugins.formatFailure(self.test, err)
File "/Users/pope/Desktop/mox_test/nose-0.10.4-py2.6.egg/nose/plugins/manager.py", line
81, in __call__
return self.call(*arg, **kw)
File "/Users/pope/Desktop/mox_test/nose-0.10.4-py2.6.egg/nose/plugins/manager.py", line
119, in chain
result = meth(*arg, **kw)
File "/Users/pope/Desktop/mox_test/nose-0.10.4-py2.6.egg/nose/plugins/failuredetail.py",
line 40, in formatFailure
tbinfo = inspect_traceback(tb)
File "/Users/pope/Desktop/mox_test/nose-0.10.4-py2.6.egg/nose/inspector.py", line 33, in
inspect_traceback
inspect_lines, mark_line = find_inspectable_lines(lines, exc_line)
File "/Users/pope/Desktop/mox_test/nose-0.10.4-py2.6.egg/nose/inspector.py", line 122, in
find_inspectable_lines
home = lines[pos]
TypeError: 'NoneType' object is unsubscriptable

----------------------------------------------------------------------

What version of the product are you using? On what operating system?
I'm using Mox 0.5.0, Nose 0.10.4, Python 2.5 and 2.6, Mac OS X 10.5.6 Intel

Please provide any additional information below.
I set up a REALLY dumb test case at http://gist.github.com/74723

Google Code Info:
Issue #: 241
Author: K.Adam.C...@gmail.com
Created On: 2009-03-06T03:13:55.000Z
Closed On: 2009-03-06T15:11:40.000Z