Use a unittest style test to support more test runners

This commit is contained in:
Joe Rickerby
2022-12-05 19:52:09 +00:00
parent c417dce602
commit a157a51225
2 changed files with 23 additions and 15 deletions
+14 -11
View File
@@ -1,14 +1,17 @@
# this file is copied to the testing cwd, to raise the below error message if
# pytest is run from there
# pytest/unittest is run from there.
import unittest
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."
)
class TestStringMethods(unittest.TestCase):
def test_fail(self):
self.fail(
"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."
)