def test_patch_and_restore(self): cleanup = monkeypatch( 'testrepository.tests.test_monkeypatch.reference', 45) self.assertEqual(45, reference) cleanup() self.assertEqual(23, reference)
def stub__find_command(self, cmd_run): self.calls = [] self.addCleanup(monkeypatch('testrepository.commands._find_command', self._find_command)) self.cmd_run = cmd_run
def stub__find_command(self, cmd_run): self.calls = [] self.addCleanup( monkeypatch('testrepository.commands._find_command', self._find_command)) self.cmd_run = cmd_run