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

Method test_for_loop

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

Source from the content-addressed store, hash-verified

2220class TestOptimizer(MonitoringTestBase, unittest.TestCase):
2221
2222 def test_for_loop(self):
2223 def test_func(x):
2224 i = 0
2225 while i < x:
2226 i += 1
2227
2228 code = test_func.__code__
2229 sys.monitoring.set_local_events(TEST_TOOL, code, E.PY_START)
2230 self.assertEqual(sys.monitoring.get_local_events(TEST_TOOL, code), E.PY_START)
2231 test_func(1000)
2232 sys.monitoring.set_local_events(TEST_TOOL, code, 0)
2233 self.assertEqual(sys.monitoring.get_local_events(TEST_TOOL, code), 0)
2234
2235class TestTier2Optimizer(CheckEvents):
2236

Callers

nothing calls this directly

Calls 2

test_funcClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected