def test_watch_match(self): self.tracer.watch("no_mod") with self.tm: testmod.f() self.assertEqual(0, self.mock.call_count) self.tracer.unwatch("no_mod") self.tracer.watch("testmod.f") with self.tm: testmod.f() self.assertNotEqual(0, self.mock.call_count)
def test_watch_not(self): self.tracer.watch("-testmod.A.*") with self.tm: testmod.f() self.assertNotEqual(0, self.mock.call_count) self.mock.reset_mock() a = testmod.A() with self.tm: a.m1() self.assertEqual(0, self.mock.call_count)
def test_global_func_qual_name(self): q = tracerlib.FrameInspector(testmod.f()).qual_name self.assertEqual('testmod.f', q)