Mock Patching Methods¶ Common uses for Mock objects include: Patching methods Recording method calls on objects You might want to replace a method on an object to check that it is called with the correct arguments by another part of the system: >>> real = SomeClass() >>> real.method = MagicMock(name='method') >>> real.method(3, 4, 5, key='value') <MagicMock name='method()' id='...'> Once our mock