Enable Python 3.10's ``EncodingWarning``

This warns on the default encoding being used in ``open`` or ``io.open``,
which can lead to cross-platform bugs (for example on Windows where the
default codepage is cp1252), or with the upcoming change to the default Python
encoding (PEP 686, Make UTF-8 mode default https://peps.python.org/pep-0686/)
This commit is contained in:
Adam Turner 2022-10-01 00:12:07 +01:00 committed by Ran Benita
parent a15f544962
commit 6301147aca
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,10 @@ passenv =
setenv =
_PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:}
# Warn where default encoding is used
# https://docs.python.org/3/library/io.html#io-encoding-warning
PYTHONWARNDEFAULTENCODING=1
# Configuration to run with coverage similar to CI, e.g.
# "tox -e py37-coverage".
coverage: _PYTEST_TOX_COVERAGE_RUN=coverage run -m