From 104fe35e39b67e21e9a598dda416dd32e31013c3 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Fri, 23 Jan 2026 23:04:15 -0800 Subject: [PATCH] Add another test to get some additional coverage that's timing dependent (#1242). --- tests/integration/test_execute.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/integration/test_execute.py b/tests/integration/test_execute.py index dba1ba61..4617fe5d 100644 --- a/tests/integration/test_execute.py +++ b/tests/integration/test_execute.py @@ -38,6 +38,19 @@ def test_read_lines_yields_multiple_lines_plus_partial_line(): assert tuple(module.read_lines(process.stdout, process)) == (('hi', 'there'), ('partial',)) +def test_read_lines_with_longer_running_process_yields_many_lines(): + process = subprocess.Popen( + [ + sys.executable, + '-c', + "import random, string; print('\\n'.join(random.choice(string.ascii_letters) for _ in range(1000)))", + ], + stdout=subprocess.PIPE, + ) + + assert tuple(module.read_lines(process.stdout, process)) + + def test_read_lines_yields_nothing(): process = subprocess.Popen(['echo', '-n'], stdout=subprocess.PIPE)