From ac6d92d59251fcdcb8d22c4b1aaf7d09f624dfda Mon Sep 17 00:00:00 2001 From: Anze Staric Date: Fri, 20 Jan 2023 13:28:42 +0100 Subject: [PATCH] trying to figure out what the extra items are --- tests/test_pipelines.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_pipelines.py b/tests/test_pipelines.py index 0f5b933c9..80a849497 100644 --- a/tests/test_pipelines.py +++ b/tests/test_pipelines.py @@ -13,6 +13,9 @@ def test_draining_stderr(generate_cmd, process_cmd): stdout, stderr = get_output_with_iter_lines( generate_cmd | process_cmd | process_cmd ) + expected_output = {f"generated {i}" for i in range(5000)} + expected_output.update(f"consumed {i}" for i in range(5000)) + assert set(stderr) - expected_output == set() assert len(stderr) == 15000 assert len(stdout) == 5000 @@ -23,6 +26,9 @@ def test_draining_stderr_with_stderr_redirect(tmp_path, generate_cmd, process_cm stdout, stderr = get_output_with_iter_lines( generate_cmd | (process_cmd >= str(tmp_path / "output.txt")) | process_cmd ) + expected_output = {f"generated {i}" for i in range(5000)} + expected_output.update(f"consumed {i}" for i in range(5000)) + assert set(stderr) - expected_output == set() assert len(stderr) == 10000 assert len(stdout) == 5000 @@ -33,6 +39,9 @@ def test_draining_stderr_with_stdout_redirect(tmp_path, generate_cmd, process_cm stdout, stderr = get_output_with_iter_lines( generate_cmd | process_cmd | process_cmd > str(tmp_path / "output.txt") ) + expected_output = {f"generated {i}" for i in range(5000)} + expected_output.update(f"consumed {i}" for i in range(5000)) + assert set(stderr) - expected_output == set() assert len(stderr) == 15000 assert len(stdout) == 0