|
2 | 2 | """Test basic executor functionality.""" |
3 | 3 |
|
4 | 4 | import gc |
5 | | -import platform |
6 | 5 | import shlex |
7 | 6 | import signal |
8 | 7 | import uuid |
@@ -109,56 +108,22 @@ def test_context_stopped() -> None: |
109 | 108 |
|
110 | 109 |
|
111 | 110 | @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: |
130 | 112 | """Start a process, check output and shut it down.""" |
131 | 113 | executor = SimpleExecutor(command) |
132 | 114 | executor.start() |
133 | 115 |
|
134 | | - assert executor.output().read() == expected_output, f"command was {command!r}" |
| 116 | + assert executor.output().read() == "foobar\n", f"command was {command!r}" |
135 | 117 | executor.stop() |
136 | 118 |
|
137 | 119 |
|
138 | 120 | @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: |
157 | 122 | """Start a process, check output and shut it down with shell set to True.""" |
158 | 123 | executor = SimpleExecutor(command, shell=True) |
159 | 124 | executor.start() |
160 | 125 |
|
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}" |
162 | 127 | executor.stop() |
163 | 128 |
|
164 | 129 |
|
|
0 commit comments