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

Method test_try_except

Lib/test/test_monitoring.py:1168–1189  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1166 ('call', 'set_events', 2)])
1167
1168 def test_try_except(self):
1169
1170 def func3():
1171 try:
1172 line = 2
1173 raise KeyError
1174 except:
1175 line = 5
1176 line = 6
1177
1178 self.check_events(func3, recorders = MANY_RECORDERS, expected = [
1179 ('line', 'get_events', 10),
1180 ('call', 'func3', sys.monitoring.MISSING),
1181 ('line', 'func3', 1),
1182 ('line', 'func3', 2),
1183 ('line', 'func3', 3),
1184 ('raise', KeyError),
1185 ('line', 'func3', 4),
1186 ('line', 'func3', 5),
1187 ('line', 'func3', 6),
1188 ('line', 'get_events', 11),
1189 ('call', 'set_events', 2)])
1190
1191class InstructionRecorder:
1192

Callers

nothing calls this directly

Calls 1

check_eventsMethod · 0.45

Tested by

no test coverage detected