@@ -215,18 +215,21 @@ def test_empty_xbuild_tool_definition(tmp_path, capfd):
215215
216216
217217def test_ios_test_command_without_python_dash_m (tmp_path , capfd ):
218- """Test command should be able to run without python -m."""
218+ """pytest should be able to run without python -m, but it should warn ."""
219219 if utils .platform != "macos" :
220220 pytest .skip ("this test can only run on macOS" )
221221 if utils .get_xcode_version () < (13 , 0 ):
222222 pytest .skip ("this test only works with Xcode 13.0 or greater" )
223223
224224 project_dir = tmp_path / "project"
225+
225226 project = test_projects .new_c_project ()
226- project .files ["tests_module/__init__.py" ] = ""
227- project .files ["tests_module/__main__.py" ] = textwrap .dedent ("""
228- if __name__ == "__main__":
229- print("Hello from tests_module")
227+ project .files ["tests/__init__.py" ] = ""
228+ project .files ["tests/test_spam.py" ] = textwrap .dedent ("""
229+ import spam
230+ def test_spam():
231+ assert spam.filter("spam") == 0
232+ assert spam.filter("ham") != 0
230233 """ )
231234 project .generate (project_dir )
232235
@@ -235,8 +238,9 @@ def test_ios_test_command_without_python_dash_m(tmp_path, capfd):
235238 add_env = {
236239 "CIBW_PLATFORM" : "ios" ,
237240 "CIBW_BUILD" : "cp313-*" ,
238- "CIBW_TEST_COMMAND" : "tests_module" ,
239- "CIBW_TEST_SOURCES" : "tests_module" ,
241+ "CIBW_TEST_COMMAND" : "pytest ./tests" ,
242+ "CIBW_TEST_SOURCES" : "tests" ,
243+ "CIBW_TEST_REQUIRES" : "pytest" ,
240244 "CIBW_XBUILD_TOOLS" : "" ,
241245 },
242246 )
0 commit comments