[issue27376] Add mock_import method to mock module

2016-06-23 Thread Eyal Posener
New submission from Eyal Posener: Add mock_import method. A helper function to mask ``ImportError``s on a scoped code, using the ``with`` statement, or in method a method used as a decorator. Failed imports will be ignored, unless specified by the *do_not_mock* argument. The *do_not_mock

[issue27376] Add mock_import method to mock module

2016-09-01 Thread Eyal Posener
Eyal Posener added the comment: Thanks for the review, Michael. About the use case: I use it for a process with loads code and inspect it's classes and methods. When I run this process, not always I have all the dependencies of the inspected code, so I found myself mocking all those pac