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

Method test_func

Lib/test/test_monitoring.py:2237–2246  ·  view source on GitHub ↗
(recorder)

Source from the content-addressed store, hash-verified

2235 @unittest.skipUnless(_testinternalcapi, "requires _testinternalcapi")
2236 def test_monitoring_already_opimized_loop(self):
2237 def test_func(recorder):
2238 set_events = sys.monitoring.set_events
2239 line = E.LINE
2240 i = 0
2241 for i in range(_testinternalcapi.SPECIALIZATION_THRESHOLD + 51):
2242 # Turn on events without branching once i reaches _testinternalcapi.SPECIALIZATION_THRESHOLD.
2243 set_events(TEST_TOOL, line * int(i >= _testinternalcapi.SPECIALIZATION_THRESHOLD))
2244 pass
2245 pass
2246 pass
2247
2248 self.assertEqual(sys.monitoring._all_events(), {})
2249 events = []

Callers

nothing calls this directly

Calls 1

set_eventsFunction · 0.85

Tested by

no test coverage detected