Skip to content

EncodingWarning when PYTHONWARNDEFAULTENCODING=1 #67

@jaraco

Description

@jaraco
 pytest-black master $ tox --notest
python: install_deps> python -I -m pip install 'pytest>=3.0'
.pkg: install_requires> python -I -m pip install 'setuptools>=40.8.0' wheel
.pkg: _optional_hooks> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_sdist> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: install_requires_for_build_sdist> python -I -m pip install setuptools_scm
.pkg: prepare_metadata_for_build_wheel> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: build_sdist> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
python: install_package_deps> python -I -m pip install 'black; python_version >= "3.6"' 'pytest>=3.5.0' toml
python: install_package> python -I -m pip install --force-reinstall --no-deps /Users/jaraco/code/shopkeep/pytest-black/.tox/.tmp/package/1/pytest-black-0.3.12.tar.gz
.pkg: _exit> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
  python: OK (5.73 seconds)
  congratulations :) (5.77 seconds)
 pytest-black master $ env PYTHONWARNDEFAULTENCODING=1 .tox/python/bin/pytest
/Users/jaraco/code/shopkeep/pytest-black/.tox/python/lib/python3.11/site-packages/_pytest/faulthandler.py:30: EncodingWarning: 'encoding' argument not specified
  config.stash[fault_handler_stderr_key] = open(stderr_fd_copy, "w")
=========================================================================== test session starts ===========================================================================
platform darwin -- Python 3.11.1, pytest-7.2.1, pluggy-1.0.0
rootdir: /Users/jaraco/code/shopkeep/pytest-black
plugins: black-0.3.12
collected 9 items                                                                                                                                                         

tests/test_black.py ........                                                                                                                                        [ 88%]
tests/test_no_black.py s                                                                                                                                            [100%]

============================================================================ warnings summary =============================================================================
tests/test_black.py: 10 warnings
  /Users/jaraco/code/shopkeep/pytest-black/.tox/python/lib/python3.11/site-packages/_pytest/faulthandler.py:30: EncodingWarning: 'encoding' argument not specified
    config.stash[fault_handler_stderr_key] = open(stderr_fd_copy, "w")

tests/test_black.py::test_pass
tests/test_black.py::test_mtime_cache
tests/test_black.py::test_mtime_cache
tests/test_black.py::test_exclude
tests/test_black.py::test_exclude_folder
tests/test_black.py::test_include
tests/test_black.py::test_pytest_deprecation_warning
  /Users/jaraco/code/shopkeep/pytest-black/.tox/python/lib/python3.11/site-packages/_pytest/_py/error.py:85: EncodingWarning: 'encoding' argument not specified
    return func(*args, **kwargs)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================ 8 passed, 1 skipped, 17 warnings in 0.85s ================================================================

See PEP 597 for background.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions