From 883621419c7069f7d9c7c7c1e57fe5960b6935a9 Mon Sep 17 00:00:00 2001 From: Blair Conrad Date: Wed, 23 Oct 2024 12:45:47 -0400 Subject: [PATCH] Flush test_capture_function_and_subprocess_output print/writes so output is in expected order --- tests/test_runners.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_runners.py b/tests/test_runners.py index 353904b..7a6da97 100644 --- a/tests/test_runners.py +++ b/tests/test_runners.py @@ -345,8 +345,9 @@ def test_capture_function_and_subprocess_output(capsys: pytest.CaptureFixture) - """ def function() -> None: - print("print") + print("print", flush=True) sys.stdout.write("sys stdout write\n") + sys.stdout.flush() os.system("echo os system") # noqa: S605,S607 subprocess.run(["sh", "-c", "echo sh -c echo"], check=False) # noqa: S603,S607