[TIP] Mocking import functions

Mahdi Yusuf yusuf.mahdi at gmail.com
Fri Feb 7 07:42:49 PST 2014


I am at my wits end pretty much. I am not sure what is happening here.

I am unable to mock an import function. My code is
here<https://gist.github.com/myusuf3/685083e70bf3f93fd43c>.
After some reading I know you patch where the function is used not where
its defined.

I have also tried everything else but the mechanize_url is till running as
implemented in code not mocked in test.

Thoughts?

-- 
Mahdi Yusuf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20140207/170e9614/attachment.htm>


More information about the testing-in-python mailing list