On Jan 10, 4:19 pm, Rob Williscroft <r...@freenet.co.uk> wrote: > Note that doing the above *before* any other module imports > from sender, will be sufficient in *any* case, though it won't > help if the tested code calls reload( sender ).
Yeah, of course, but most of the time, you want to mock at the *test* level, (you don't want your mock to affect all the tests in your module), so you can't just mock the function before you import your tested module. That is why I created this handy TestCase. -- http://mail.python.org/mailman/listinfo/python-list