From 853bd3436e00be6faf10921b9363464713ab816d Mon Sep 17 00:00:00 2001 From: "Nathaniel J. Smith" Date: Sat, 23 May 2020 02:38:22 -0700 Subject: [PATCH] Another attempt to fix flakiness in test_subprocess::test_basic In gh-1546 I fixed the flakiness due to the returncode changing when the process exits, but I missed that the repr also changes... --- trio/tests/test_subprocess.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/trio/tests/test_subprocess.py b/trio/tests/test_subprocess.py index ae19f8b789..17f1cb941c 100644 --- a/trio/tests/test_subprocess.py +++ b/trio/tests/test_subprocess.py @@ -48,15 +48,12 @@ def got_signal(proc, sig): async def test_basic(): - repr_template = "".format(EXIT_TRUE) async with await open_process(EXIT_TRUE) as proc: - assert isinstance(proc, Process) - assert repr(proc) == repr_template.format( - "running with PID {}".format(proc.pid) - ) + pass + assert isinstance(proc, Process) assert proc._pidfd is None assert proc.returncode == 0 - assert repr(proc) == repr_template.format("exited with status 0") + assert repr(proc) == f"" async with await open_process(EXIT_FALSE) as proc: pass @@ -69,9 +66,11 @@ async def test_basic(): async def test_auto_update_returncode(): p = await open_process(SLEEP(9999)) assert p.returncode is None + assert "running" in repr(p) p.kill() p._proc.wait() assert p.returncode is not None + assert "exited" in repr(p) assert p._pidfd is None assert p.returncode is not None