PyCQA / pycodestyle

Simple Python style checker in one Python file
https://pycodestyle.pycqa.org
Other
5.01k stars 755 forks source link

Tests fail with sources from PyPI for v2.11.1 #1209

Closed lcheylus closed 10 months ago

lcheylus commented 10 months ago

When I try to test pycodestyle v2.11.1 with sources from PyPI, tests with pytest fail.

Steps to reproduce issue

$ pycodestyle --version 2.11.1 $ which pycodestyle /home/fox/tmp/pycodestyle-2.11.1/venv/bin/pycodestyle


- Tests with `pytest` fail (as described in [CONTRIBUTING.rst](https://github.com/PyCQA/pycodestyle/blob/main/CONTRIBUTING.rst)

$ pytest tests __ ERROR collecting tests/test_E101.py _____ ImportError while importing test module '/home/fox/tmp/pycodestyle-2.11.1/tests/test_E101.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.10/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_E101.py:5: in from testing.support import errors_from_src E ModuleNotFoundError: No module named 'testing' __ ERROR collecting tests/test_E901.py ___ ImportError while importing test module '/home/fox/tmp/pycodestyle-2.11.1/tests/test_E901.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.10/importlib/init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_E901.py:5: in from testing.support import errors_from_src E ModuleNotFoundError: No module named 'testing' (...)



These errors are due to the fact that the **directory `testing` in not included** in sources bundle downloaded from PyPI repository.
asottile commented 10 months ago

please search the issue tracker