From 36c263f3647bc4c8156360c24e66a196a3670612 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Sun, 11 Aug 2019 13:30:28 +0900 Subject: [PATCH] Fix stdlib_subprocess for macOS --- tests/snippets/stdlib_subprocess.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/snippets/stdlib_subprocess.py b/tests/snippets/stdlib_subprocess.py index 1202d8ef71f..9e04f49347a 100644 --- a/tests/snippets/stdlib_subprocess.py +++ b/tests/snippets/stdlib_subprocess.py @@ -28,7 +28,9 @@ p = subprocess.Popen(["echo", "test"], stdout=subprocess.PIPE) p.wait() -if "win" not in sys.platform: +is_unix = "win" not in sys.platform or "darwin" in sys.platform + +if is_unix: # unix test_output = b"test\n" else: @@ -40,7 +42,7 @@ p = subprocess.Popen(["sleep", "2"]) p.terminate() p.wait() -if "win" not in sys.platform: +if is_unix: assert p.returncode == -signal.SIGTERM else: assert p.returncode == 1 @@ -48,7 +50,7 @@ p = subprocess.Popen(["sleep", "2"]) p.kill() p.wait() -if "win" not in sys.platform: +if is_unix: assert p.returncode == -signal.SIGKILL else: assert p.returncode == 1