MarkBerlin78 / pymox

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

mox.Func matcher should report exceptions differently from negative #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. make a test with mox.Func(myfunc)
2. put a bug into myfunc that raises an exception
3. run your test

What is the expected output?

          a report of the exception raised

What do you see instead?

          a mismatch

Original issue reported on code.google.com by s...@google.com on 19 Apr 2011 at 9:37

GoogleCodeExporter commented 9 years ago
It appears that the Comparator class is converting all exceptions in child 
classes into False return values from the __eq__ method. This should be 
unnecessary, as comparators that could raise exceptions are already handling 
them (and in the case of Func, we want the Comparator to let the exception 
escape so modules like unittest can be used in Func-wrapped validators).

I believe I have addressed the issue without introducing undesired behavior. 
Patch attached.

Original comment by mtomc...@google.com on 6 May 2011 at 5:26

Attachments:

GoogleCodeExporter commented 9 years ago
I've just accepted this patch as r62.  My editor managed to discard the log 
message.  Sorry.

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

GoogleCodeExporter commented 9 years ago

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