From a2a486a263a773c3d8b0a901034c605ba5eced9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20=C5=9Aliwi=C5=84ski?= Date: Thu, 6 May 2021 18:21:42 +0200 Subject: [PATCH] Expected foobar --- tests/executors/test_executor.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/executors/test_executor.py b/tests/executors/test_executor.py index 58a027a2..4b075085 100644 --- a/tests/executors/test_executor.py +++ b/tests/executors/test_executor.py @@ -1,6 +1,7 @@ # mypy: no-strict-optional """Test basic executor functionality.""" import gc +import platform import shlex from subprocess import check_output import uuid @@ -104,6 +105,10 @@ def test_context_stopped(): ECHO_FOOBAR = 'echo "foobar"' +if platform.system() == "Windows": + EXPECTED_FOOBAR = '"foobar"' +else: + EXPECTED_FOOBAR ='foobar' @pytest.mark.parametrize("command", (ECHO_FOOBAR, shlex.split(ECHO_FOOBAR))) @@ -112,7 +117,7 @@ def test_process_output(command): executor = SimpleExecutor(command) executor.start() - assert executor.output().read() == "foobar\n" + assert executor.output().read() == EXPECTED_FOOBAR + "\n" executor.stop() @@ -122,7 +127,7 @@ def test_process_output_shell(command): executor = SimpleExecutor(command, shell=True) executor.start() - assert executor.output().read().strip() == "foobar" + assert executor.output().read().strip() == EXPECTED_FOOBAR executor.stop()