@@ -2118,9 +2118,7 @@ def test_pstats_collector_cumulative_percentage_cannot_exceed_100(self):
21182118 cumulative_calls = stats [1 ]
21192119 self .assertEqual (cumulative_calls , 10 )
21202120
2121- def test_pstats_collector_different_lines_same_function_counted_separately (
2122- self ,
2123- ):
2121+ def test_pstats_collector_different_lines_same_function_counted_separately (self ):
21242122 """Test that different line numbers in same function are tracked separately."""
21252123 collector = PstatsCollector (sample_interval_usec = 1000 )
21262124
@@ -2327,23 +2325,17 @@ def test_flamegraph_collector_with_location_info(self):
23272325 frame = MockFrameInfo ("app.py" , 100 , "process_data" )
23282326 frames = [
23292327 MockInterpreterInfo (
2330- 0 , [MockThreadInfo (1 , [frame ], status = THREAD_STATUS_HAS_GIL )]
2328+ 0 ,
2329+ [MockThreadInfo (1 , [frame ], status = THREAD_STATUS_HAS_GIL )]
23312330 )
23322331 ]
23332332 collector .collect (frames )
23342333
23352334 data = collector ._convert_to_flamegraph_format ()
23362335 # Verify the function name includes lineno from location
23372336 strings = data .get ("strings" , [])
2338- name_found = any (
2339- "process_data" in s and "100" in s
2340- for s in strings
2341- if isinstance (s , str )
2342- )
2343- self .assertTrue (
2344- name_found ,
2345- f"Expected to find 'process_data' with line 100 in { strings } " ,
2346- )
2337+ name_found = any ("process_data" in s and "100" in s for s in strings if isinstance (s , str ))
2338+ self .assertTrue (name_found , f"Expected to find 'process_data' with line 100 in { strings } " )
23472339
23482340 def test_gecko_collector_with_location_info (self ):
23492341 """Test GeckoCollector handles LocationInfo properly."""
@@ -2352,7 +2344,8 @@ def test_gecko_collector_with_location_info(self):
23522344 frame = MockFrameInfo ("server.py" , 50 , "handle_request" )
23532345 frames = [
23542346 MockInterpreterInfo (
2355- 0 , [MockThreadInfo (1 , [frame ], status = THREAD_STATUS_HAS_GIL )]
2347+ 0 ,
2348+ [MockThreadInfo (1 , [frame ], status = THREAD_STATUS_HAS_GIL )]
23562349 )
23572350 ]
23582351 collector .collect (frames )
0 commit comments