Add test failure with descriptive error message when running tests without a {project} placeholder

This commit is contained in:
Joe Rickerby
2022-11-06 11:02:01 +00:00
parent 2e6cbe2435
commit e4cbe81f3f
6 changed files with 69 additions and 10 deletions
@@ -0,0 +1,14 @@
# this file is copied to the testing cwd, to raise the below error message if
# pytest is run from there
def test():
assert False, (
"cibuildwheel executes tests from a different working directory to "
"your project. This ensures only your wheel is imported, preventing "
"Python from accessing files that haven't been packaged into the "
"wheel. Please specify a path to your tests when invoking pytest "
"using the {project} placeholder, e.g. `pytest {project}` or "
"`pytest {project}/tests`. cibuildwheel will replace {project} with "
"the path to your project."
)