[TIP] strange mock behaviour
andrea.crotti.0 at gmail.com
Thu Jun 13 01:48:23 PDT 2013
I figured it out in the end.
Basically the module I wanted to patch had the same name of a package that
was imported in __init__.py.
This made the name clash and mock was getting confused of coursre,
2013/6/12 andrea crotti <andrea.crotti.0 at gmail.com>
> I'm having a strange issue with Mock (version 1.0.1) that I've never
> noticed before
> So I have a patch in this form:
> def test_challenge_ended_going_in_review(self, fake_create):
> but I get an error from that same test complaining about:
> AttributeError: <module 'app.handlers.notifications' from
> does not have the attribute 'create_notification'
> but I can't figure how and why it adds the "handlers" in between..
> app/notifications.py is a perfectly normal module, what could be messing
> up things?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python