@@ -14,8 +14,8 @@ def test_ingestion_stage_context_records_duration():
1414 pass
1515 assert len (report .ingestion_stage_durations ) == 1
1616 key = next (iter (report .ingestion_stage_durations .keys ()))
17- assert key [ 0 ] == IngestionHighStage . _UNDEFINED
18- assert "Test Stage" in key [ 1 ]
17+ assert "Ingestion" in key
18+ assert "Test Stage" in key
1919
2020
2121def test_ingestion_stage_context_handles_exceptions ():
@@ -27,7 +27,8 @@ def test_ingestion_stage_context_handles_exceptions():
2727 pass
2828 assert len (report .ingestion_stage_durations ) == 1
2929 key = next (iter (report .ingestion_stage_durations .keys ()))
30- assert "Test Stage" in key [1 ]
30+ assert "Ingestion" in key
31+ assert "Test Stage" in key
3132
3233
3334def test_ingestion_stage_context_report_handles_multiple_stages ():
@@ -45,9 +46,9 @@ def test_ingestion_stage_context_report_handles_multiple_stages():
4546 )
4647
4748 sorted_stages = list (sorted (report .ingestion_stage_durations .keys ()))
48- assert "Test Stage 1" in sorted_stages [0 ][ 1 ]
49- assert "Test Stage 2" in sorted_stages [1 ][ 1 ]
50- assert "Test Stage 3" in sorted_stages [2 ][ 1 ]
49+ assert "Test Stage 1" in sorted_stages [0 ]
50+ assert "Test Stage 2" in sorted_stages [1 ]
51+ assert "Test Stage 3" in sorted_stages [2 ]
5152
5253
5354def test_ingestion_stage_context_report_handles_nested_stages ():
@@ -64,14 +65,14 @@ def test_ingestion_stage_context_report_handles_nested_stages():
6465 for duration in report .ingestion_stage_durations .values ()
6566 )
6667 sorted_stages = list (sorted (report .ingestion_stage_durations .keys ()))
67- assert "Inner1" in sorted_stages [0 ][ 1 ]
68- assert "Inner2" in sorted_stages [1 ][ 1 ]
69- assert "Outer" in sorted_stages [2 ][ 1 ]
68+ assert "Inner1" in sorted_stages [0 ]
69+ assert "Inner2" in sorted_stages [1 ]
70+ assert "Outer" in sorted_stages [2 ]
7071
7172 # Check that outer stage duration >= sum of inner stage durations
72- outer_key = [k for k in report .ingestion_stage_durations if "Outer" in k [ 1 ] ][0 ]
73- inner1_key = [k for k in report .ingestion_stage_durations if "Inner1" in k [ 1 ] ][0 ]
74- inner2_key = [k for k in report .ingestion_stage_durations if "Inner2" in k [ 1 ] ][0 ]
73+ outer_key = [k for k in report .ingestion_stage_durations if "Outer" in k ][0 ]
74+ inner1_key = [k for k in report .ingestion_stage_durations if "Inner1" in k ][0 ]
75+ inner2_key = [k for k in report .ingestion_stage_durations if "Inner2" in k ][0 ]
7576
7677 outer_duration = report .ingestion_stage_durations [outer_key ]
7778 inner1_duration = report .ingestion_stage_durations [inner1_key ]
@@ -96,6 +97,6 @@ def test_ingestion_stage_with_high_stage():
9697 time .sleep (0.1 )
9798 assert len (report .ingestion_stage_durations ) == 1
9899 key = next (iter (report .ingestion_stage_durations .keys ()))
99- assert key [ 0 ] == IngestionHighStage . PROFILING
100- assert "Test Stage" in key [ 1 ]
100+ assert "Profiling" in key
101+ assert "Test Stage" in key
101102 assert report .ingestion_high_stage_seconds [IngestionHighStage .PROFILING ] > 0
0 commit comments