Exemplo n.º 1
0
 def make(self, dep_resources):
     new_root = logging.RootLogger(logging.WARNING)
     new_manager = logging.Manager(new_root)
     new_manager.emittedNoHandlerWarning = 1
     return OldState(
         [
             monkeypatch("logging.root", new_root),
             monkeypatch("logging.Logger.root", new_root),
             monkeypatch("logging.Logger.manager", new_manager),
         ]
     )
Exemplo n.º 2
0
 def stub__find_command(self, cmd_run):
     self.calls = []
     self.addCleanup(monkeypatch("l_mirror.commands._find_command", self._find_command))
     self.cmd_run = cmd_run
Exemplo n.º 3
0
 def test_patch_and_restore(self):
     cleanup = monkeypatch("l_mirror.tests.test_monkeypatch.reference", 45)
     self.assertEqual(45, reference)
     cleanup()
     self.assertEqual(23, reference)