MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_try_except

Method test_try_except

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

Source from the content-addressed store, hash-verified

1174 ('call', 'set_events', 2)])
1175
1176 def test_try_except(self):
1177
1178 def func3():
1179 try:
1180 line = 2
1181 raise KeyError
1182 except:
1183 line = 5
1184 line = 6
1185
1186 self.check_events(func3, recorders = MANY_RECORDERS, expected = [
1187 ('line', 'get_events', 10),
1188 ('call', 'func3', sys.monitoring.MISSING),
1189 ('line', 'func3', 1),
1190 ('line', 'func3', 2),
1191 ('line', 'func3', 3),
1192 ('raise', KeyError),
1193 ('line', 'func3', 4),
1194 ('line', 'func3', 5),
1195 ('line', 'func3', 6),
1196 ('line', 'get_events', 11),
1197 ('call', 'set_events', 2)])
1198
1199class InstructionRecorder:
1200

Callers

nothing calls this directly

Calls 1

check_eventsMethod · 0.45

Tested by

no test coverage detected