-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Turn EncodingWarning into errors and cleanup pytest.ini
#4255
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
abravalheri
merged 16 commits into
pypa:main
from
Avasam:EncodingWarning-spam-reduction-pytest.ini
Apr 25, 2024
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
80d101e
Update `pytest.ini` for `EncodingWarning` from external libraries
Avasam 9acea31
Remove distutils EncodingWarning exclusion in pytest.ini
Avasam 27f5e0a
Ignore encoding warnings bu only in in stdlib's distutils
abravalheri ef7d259
Remove EncodingWarning workarounds for setuptools from pytest.ini
abravalheri 4fc0b15
Fix EncodingWarning in test_build_meta
abravalheri d7ac06f
Return comment to pytest.ini that got lost in changes
abravalheri 969f00b
Re-enable warning filter for distutils.text_file inside test_excluded…
abravalheri 919e393
Attempt to fix errors in mypy for PyPy (test of hypothesis)
abravalheri 57ea91b
Attempt to solve the problem in PyPy
abravalheri 1316a61
Better wording for comment in pytest.ini
abravalheri 8dc50cc
Add newsfragment
Avasam b69c0de
Update comment
Avasam b341011
Fix Windows issue
Avasam 22ca7e5
Update comment in pytest.ini
abravalheri 3ea4aa9
Improve RST syntax on news fragment.
abravalheri 0faba50
Fix typo
Avasam 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Treat ``EncodingWarning``s as errors in tests. -- by :user:`Avasam` |
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 |
|---|---|---|
| @@ -1,10 +1,15 @@ | ||
| import locale | ||
| import sys | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| __all__ = ['fail_on_ascii'] | ||
|
|
||
|
|
||
| is_ascii = locale.getpreferredencoding() == 'ANSI_X3.4-1968' | ||
| locale_encoding = ( | ||
| locale.getencoding() | ||
| if sys.version_info >= (3, 11) | ||
| else locale.getpreferredencoding(False) | ||
| ) | ||
| is_ascii = locale_encoding == 'ANSI_X3.4-1968' | ||
| fail_on_ascii = pytest.mark.xfail(is_ascii, reason="Test fails in this locale") |
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
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.