-
Notifications
You must be signed in to change notification settings - Fork 284
Revert to running tests from from a temp dir when test-sources is unset #2420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9a5a2c8
Revert to running tests from from a temp dir when test-sources is unset
joerick 9bc3209
Fix placeholders error message, add test for it
joerick 660b0e4
Add back {project} placeholders to CIBW_TEST_COMMAND in tests & docs
joerick 68152a5
Update test/test_before_test.py
henryiii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# this file is copied to the testing cwd, to raise the below error message if | ||
# pytest/unittest is run from there. | ||
|
||
import sys | ||
import unittest | ||
from typing import NoReturn | ||
|
||
|
||
class TestStringMethods(unittest.TestCase): | ||
def test_fail(self) -> NoReturn: | ||
if sys.platform == "ios": | ||
msg = ( | ||
"You tried to run tests from the testbed app's working " | ||
"directory, without specifying `test-sources`. " | ||
"On iOS, you must copy your test files to the testbed app by " | ||
"setting the `test-sources` option in your cibuildwheel " | ||
"configuration." | ||
) | ||
else: | ||
msg = ( | ||
"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. " | ||
"\n\n" | ||
"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. " | ||
"\n\n" | ||
"Alternatively, you can specify your test files using the " | ||
"`test-sources` option, and cibuildwheel will copy them to the " | ||
"working directory for testing." | ||
) | ||
|
||
self.fail(msg) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.