@@ -154,7 +154,10 @@ def test_failing_test(tmp_path):
154
154
assert len (os .listdir (output_dir )) == 0
155
155
156
156
157
- def test_bare_pytest_invocation (tmp_path : Path , capfd : pytest .CaptureFixture [str ]):
157
+ @pytest .mark .parametrize ("test_runner" , ["pytest" , "unittest" ])
158
+ def test_bare_pytest_invocation (
159
+ tmp_path : Path , capfd : pytest .CaptureFixture [str ], test_runner : str
160
+ ):
158
161
"""Check that if a user runs pytest in the the test cwd, it raises a helpful error"""
159
162
project_dir = tmp_path / "project"
160
163
output_dir = tmp_path / "output"
@@ -165,8 +168,10 @@ def test_bare_pytest_invocation(tmp_path: Path, capfd: pytest.CaptureFixture[str
165
168
project_dir ,
166
169
output_dir = output_dir ,
167
170
add_env = {
168
- "CIBW_TEST_REQUIRES" : "pytest" ,
169
- "CIBW_TEST_COMMAND" : "python -m pytest" ,
171
+ "CIBW_TEST_REQUIRES" : "pytest" if test_runner == "pytest" else "" ,
172
+ "CIBW_TEST_COMMAND" : (
173
+ "python -m pytest" if test_runner == "pytest" else "python -m unittest"
174
+ ),
170
175
# Skip CPython 3.8 on macOS arm64, see comment above in
171
176
# 'test_failing_test'
172
177
"CIBW_SKIP" : "cp38-macosx_arm64" ,
@@ -179,5 +184,5 @@ def test_bare_pytest_invocation(tmp_path: Path, capfd: pytest.CaptureFixture[str
179
184
180
185
assert (
181
186
"Please specify a path to your tests when invoking pytest using the {project} placeholder"
182
- in captured .out
187
+ in captured .out + captured . err
183
188
)
0 commit comments