[issue27197] mock.patch interactions with "from" imports

2019-12-13 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue27197] mock.patch interactions with "from" imports

2016-06-03 Thread Robert Collins
Robert Collins added the comment: So its a feature of mock that it can mock a module that doesn't exist. And the semantics of the import system are designed to be very cheap when a module is already imported - so when 'patchbug.a' is in sys.modules, import will correctly return it rather than

[issue27197] mock.patch interactions with "from" imports

2016-06-03 Thread Clark Breyman
New submission from Clark Breyman: Unclear if this is a code bug or a gotcha that should be documented: Cross posted to https://github.com/testing-cabal/mock/issues/365 Since "from"-style imports in modules bind names on the first execution of the import, there is a subtle interaction with patc