Skip to content

Commit 8ece545

Browse files
committed
fixup: check
1 parent acc47fe commit 8ece545

File tree

2 files changed

+7
-42
lines changed

2 files changed

+7
-42
lines changed

mirakuru/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ def __init__( # pylint:disable=too-many-arguments
143143
self.command_parts = shlex.split(command)
144144

145145
self._cwd = cwd
146-
self._shell = True
147-
if not IS_WINDOWS:
148-
self._shell = shell
146+
self._shell = shell
147+
# if not IS_WINDOWS:
148+
# self._shell = shell
149149

150150
self._timeout = timeout
151151
self._sleep = sleep

tests/executors/test_executor.py

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"""Test basic executor functionality."""
33

44
import gc
5-
import platform
65
import shlex
76
import signal
87
import uuid
@@ -109,56 +108,22 @@ def test_context_stopped() -> None:
109108

110109

111110
@pytest.mark.parametrize("command", (ECHO_FOOBAR, shlex.split(ECHO_FOOBAR)))
112-
@pytest.mark.parametrize(
113-
"expected_output",
114-
(
115-
pytest.param(
116-
"foobar\n",
117-
marks=pytest.mark.skipif(
118-
platform.system() == "Windows", reason="Windows leaves quotes"
119-
),
120-
),
121-
pytest.param(
122-
'"foobar"\n',
123-
marks=pytest.mark.skipif(
124-
platform.system() != "Windows", reason="Windows leaves quotes"
125-
),
126-
),
127-
),
128-
)
129-
def test_process_output(command: Union[str, List[str]], expected_output: str) -> None:
111+
def test_process_output(command: Union[str, List[str]]) -> None:
130112
"""Start a process, check output and shut it down."""
131113
executor = SimpleExecutor(command)
132114
executor.start()
133115

134-
assert executor.output().read() == expected_output, f"command was {command!r}"
116+
assert executor.output().read() == "foobar\n", f"command was {command!r}"
135117
executor.stop()
136118

137119

138120
@pytest.mark.parametrize("command", (ECHO_FOOBAR, shlex.split(ECHO_FOOBAR)))
139-
@pytest.mark.parametrize(
140-
"expected_output",
141-
(
142-
pytest.param(
143-
"foobar",
144-
marks=pytest.mark.skipif(
145-
platform.system() == "Windows", reason="Windows leaves quotes"
146-
),
147-
),
148-
pytest.param(
149-
'"foobar"',
150-
marks=pytest.mark.skipif(
151-
platform.system() != "Windows", reason="Windows leaves quotes"
152-
),
153-
),
154-
),
155-
)
156-
def test_process_output_shell(command: Union[str, List[str]], expected_output: str) -> None:
121+
def test_process_output_shell(command: Union[str, List[str]]) -> None:
157122
"""Start a process, check output and shut it down with shell set to True."""
158123
executor = SimpleExecutor(command, shell=True)
159124
executor.start()
160125

161-
assert executor.output().read().strip() == expected_output, f"command was {command!r}"
126+
assert executor.output().read().strip() == "foobar", f"command was {command!r}"
162127
executor.stop()
163128

164129

0 commit comments

Comments
 (0)