File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ def test_ordered_map_empty():
102102 pool = ParallelWorkerPool (worker = SquareWorker , config = PoolConfig (num_workers = 2 ))
103103 results = list (pool .ordered_map ([]))
104104 assert results == []
105+ # Verify processes are joined and list is cleared
106+ assert len (pool .processes ) == 0
105107
106108
107109def test_ordered_map_generator ():
@@ -635,3 +637,13 @@ def test_get_items_from_queue_error_handling():
635637
636638 with pytest .raises (Exception , match = "Queue error" ):
637639 list (_get_items_from_queue (mock_queue ))
640+
641+
642+ def test_semi_ordered_map_empty ():
643+ """Test semi_ordered_map with an empty stream."""
644+ pool = ParallelWorkerPool (worker = SquareWorker , config = PoolConfig (num_workers = 2 ))
645+ stream = []
646+ result = list (pool .semi_ordered_map (stream ))
647+ assert result == []
648+ # Verify processes are joined and list is cleared
649+ assert len (pool .processes ) == 0
You can’t perform that action at this time.
0 commit comments