@@ -2086,36 +2086,6 @@ def callback(code, instruction_offset):
20862086 sys .monitoring .set_events (0 , 0 )
20872087
20882088
2089- @unittest .skipUnless (hasattr (_testinternalcapi , "new_counter_optimizer" ),
2090- "Requires counter optimizer" )
2091- class TestOptimizer (MonitoringTestBase , unittest .TestCase ):
2092-
2093- def setUp (self ):
2094- if hasattr (_testinternalcapi , "get_optimizer" ):
2095- self .old_opt = _testinternalcapi .get_optimizer ()
2096- opt = _testinternalcapi .new_counter_optimizer ()
2097- _testinternalcapi .set_optimizer (opt )
2098- super (TestOptimizer , self ).setUp ()
2099-
2100- def tearDown (self ):
2101- super (TestOptimizer , self ).tearDown ()
2102- import _testinternalcapi
2103- if hasattr (_testinternalcapi , "get_optimizer" ):
2104- _testinternalcapi .set_optimizer (self .old_opt )
2105-
2106- def test_for_loop (self ):
2107- def test_func (x ):
2108- i = 0
2109- while i < x :
2110- i += 1
2111-
2112- code = test_func .__code__
2113- sys .monitoring .set_local_events (TEST_TOOL , code , E .PY_START )
2114- self .assertEqual (sys .monitoring .get_local_events (TEST_TOOL , code ), E .PY_START )
2115- test_func (1000 )
2116- sys .monitoring .set_local_events (TEST_TOOL , code , 0 )
2117- self .assertEqual (sys .monitoring .get_local_events (TEST_TOOL , code ), 0 )
2118-
21192089class TestTier2Optimizer (CheckEvents ):
21202090
21212091 def test_monitoring_already_opimized_loop (self ):
0 commit comments