[TIP] mock and patch

Andrea Crotti andrea.crotti.0 at gmail.com
Thu Mar 22 07:46:25 PDT 2012


On 03/22/2012 02:42 PM, Michael Foord wrote:
>
> The error is not from a mock, but from your actual walk function - 
> which indicates that the patching is not in place. So it's likely that 
> the patch is in the wrong place. It looks like you're patching the 
> walk function in the walk module - but using it somewhere else. So 
> changing your patch to "module_importing_and_using_walk.walk" instead 
> should work.
>
> All the best,
>
> Michael
>

Actually I discovered a funny thing, I got this error by running
nosetests -m regexp

but running nosetest only I didn't, with exactly the same code.

So if I can reproduce it it might be a small bug in nose, or is it 
normal to get a different behaviour
when running only one test??



More information about the testing-in-python mailing list