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