MarkBerlin78 / pymox

Automatically exported from code.google.com/p/pymox
Apache License 2.0
0 stars 0 forks source link

Mox ExpectedMethodCallsError's _str__ method prints out one character per line #34

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
See: 
http://stackoverflow.com/questions/6124180/python-nose-tests-actually-the-error-
is-from-mox-print-out-errors-one-character

My Fix:

Adding this line to the top of str method of ExpectedMethodCallsError in mox.py 
fixes the problem (or this symptom anyway):

if isinstance(self._expected_methods, str):
  self._expected_methods = self._expected_methods.split("\n")

Original issue reported on code.google.com by almostob...@gmail.com on 26 May 2011 at 9:01

GoogleCodeExporter commented 9 years ago
Hm, this is a strange one, and it seems more like a bandaid than a proper fix.  
The real problem seems to be that the self._expected_calls_queue is being 
populated with a  string somehow, instead of being used as a deque().

Original comment by stev...@google.com on 6 Jun 2011 at 6:55

GoogleCodeExporter commented 9 years ago
I believe this is actually a problem in Nose, see:  
https://github.com/nose-devs/nose/issues/529

Original comment by jeblai...@gmail.com on 17 Jul 2012 at 11:50