Open jeblair opened 12 years ago
This also occurs when running twisted trial unit tests that leave the reactor dirty. In this case trial raises a twisted.trial.util.DirtyReactorAggregateError error which similarly takes a list as first parameter. Quite annoying...
The workarounds are ugly. This seems like a very misguided assumption in ResultProxy._prepareError
that one can recreate an exception instance by calling its class' constructor with its string representation as the (only) argument!
When using mox, if the code under test fails to call an expected method, mox raises an ExpectedMethodCallsError, which produces a nicely formatted list of methods which were not called, like this:
However, when using the nose output capture plugin (the default behavior for nose), and output is sent to stdout, this is the result:
http://paste.openstack.org/show/19473/
That's the entire contents of the captured output printed one character per line. This doesn't happen if nothing is sent to stdout, and it also doesn't happen if output capture is disabled (--nocapture). It seems to be related to nose reconstructing the raised exception by passing formatted output back in as an argument. The constructor for ExpectedMethodCallsError expects a deque object, not a string, which is what nose supplies when reconstructing it. Here's a stack trace from nose's invocation of the constructor:
Here is the simple test case I used to generate the output above: