MCPcopy Index your code
hub / github.com/python/cpython / check_events

Method check_events

Lib/test/test_sys_setprofile.py:92–101  ·  view source on GitHub ↗
(self, callable, expected, check_args=False)

Source from the content-addressed store, hash-verified

90
91class TestCaseBase(unittest.TestCase):
92 def check_events(self, callable, expected, check_args=False):
93 events = capture_events(callable, self.new_watcher())
94 if check_args:
95 if events != expected:
96 self.fail("Expected events:\n%s\nReceived events:\n%s"
97 % (pprint.pformat(expected), pprint.pformat(events)))
98 else:
99 if [(frameno, event, ident) for frameno, event, ident, arg in events] != expected:
100 self.fail("Expected events:\n%s\nReceived events:\n%s"
101 % (pprint.pformat(expected), pprint.pformat(events)))
102
103
104class ProfileHookTestCase(TestCaseBase):

Callers 15

test_simpleMethod · 0.45
test_exceptionMethod · 0.45
test_caught_exceptionMethod · 0.45
test_nested_exceptionMethod · 0.45
test_raise_twiceMethod · 0.45
test_raise_reraiseMethod · 0.45
test_raiseMethod · 0.45
test_generatorMethod · 0.45

Calls 4

capture_eventsFunction · 0.85
pformatMethod · 0.80
new_watcherMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected