First: thanks for Fudge! Love the API.
I've found an issue and am not 100% sure if it's something that can be addressed in Fudge or if I have to structure my tests differently. FWIW I'm using Fudge 0.9.2 and Nose 0.10.4 to run my tests.
In a test module I have two (soon to be more) test functions. Both of them are wrapped with @with_fakes and @with_patched_object; and both calls to @with_patched_object create new Fake objects using expect_call and times_called().
See this only slightly abstracted example for what I mean: http://dpaste.com/23853/
The problem crops up when I have two+ tests like that example (both of which make use of expect_call/times_called()): my module loads, and -- before any tests are run! -- both Fake objects are created, loading their calls into the Registry's list of expected calls. Meaning the Registry's call list now holds all calls, one for each test.
Finally, the linchpin is that when the first test executes and its @with_fakes calls Registry.verify(), it's considering both expected calls, not just the one intended for that one test. Thus, I get failures, since the 'extra' calls weren't called or weren't called enough times or etc.
I can't think of a good way around this that does not involve forgoing use of the (very helpful) decorators. Am I missing something?