I'm working on writing tests for a Python module that looks like this (edited for compactness and clarity, of course): class TestConsole(unittest.TestCase): def test_log_with_freecad(self): with patch ...