Skip to content

Commit

Permalink
trying to figure out what the extra items are
Browse files Browse the repository at this point in the history
  • Loading branch information
astaric committed Jan 20, 2023
1 parent 1b5a014 commit ac6d92d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down

0 comments on commit ac6d92d

Please sign in to comment.