KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How can I patch and mock getLogger in this module under test (MUT): # Start of the module under test import logging log = logging.getLogger('some_logger') # ... I would like to do: mock_logging.getLogger.return_value = Mock() However I can't create mock_logging before importing the MUT, but importing the MUT already calls getLogger ...
Tags (comma-separated)
Save Edits
Cancel