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

Method test_with_restart

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

Source from the content-addressed store, hash-verified

1291 ])
1292
1293 def test_with_restart(self):
1294 def func1():
1295 line1 = 1
1296 line2 = 2
1297 line3 = 3
1298
1299 self.check_events(func1, recorders = LINE_AND_INSTRUCTION_RECORDERS, expected = [
1300 ('line', 'get_events', 10),
1301 ('line', 'func1', 1),
1302 ('instruction', 'func1', 4),
1303 ('instruction', 'func1', 6),
1304 ('line', 'func1', 2),
1305 ('instruction', 'func1', 8),
1306 ('instruction', 'func1', 10),
1307 ('line', 'func1', 3),
1308 ('instruction', 'func1', 12),
1309 ('instruction', 'func1', 14),
1310 ('instruction', 'func1', 16),
1311 ('instruction', 'func1', 18),
1312 ('line', 'get_events', 11)])
1313
1314 sys.monitoring.restart_events()
1315
1316 self.check_events(func1, recorders = LINE_AND_INSTRUCTION_RECORDERS, expected = [
1317 ('line', 'get_events', 10),
1318 ('line', 'func1', 1),
1319 ('instruction', 'func1', 4),
1320 ('instruction', 'func1', 6),
1321 ('line', 'func1', 2),
1322 ('instruction', 'func1', 8),
1323 ('instruction', 'func1', 10),
1324 ('line', 'func1', 3),
1325 ('instruction', 'func1', 12),
1326 ('instruction', 'func1', 14),
1327 ('instruction', 'func1', 16),
1328 ('instruction', 'func1', 18),
1329 ('line', 'get_events', 11)])
1330
1331 def test_turn_off_only_instruction(self):
1332 """

Callers

nothing calls this directly

Calls 2

check_eventsMethod · 0.45
restart_eventsMethod · 0.45

Tested by

no test coverage detected