tholo / pytest-flake8

pytest plugin to run flake8
Other
117 stars 47 forks source link

Make it compatible with latest flake8 #96

Open Et7f3 opened 1 year ago

Et7f3 commented 1 year ago

Fix #92 This make test passes. The modification was small and I have done atomic commit to explain the fix.

kloczek commented 6 months ago

I've tested this PR and looks like pytest still fails

Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-flake8-1.1.1-7.fc36.x86_64/usr/lib64/python3.9/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-flake8-1.1.1-7.fc36.x86_64/usr/lib/python3.9/site-packages + /usr/bin/pytest -ra -m 'not network' ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0 benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-flake8-1.1.1 configfile: tox.ini plugins: flake8-1.1.1, benchmark-4.0.0, aspectlib-2.0.0 collected 16 items pytest_flake8.py F [ 6%] setup.py F [ 12%] test_flake8.py F..FFFF.FFF.xF [100%] [..] ================================================================================== short test summary info ================================================================================== XFAIL test_flake8.py::test_strict - flake8 is not properly registered as a marker FAILED pytest_flake8.py::flake-8::FLAKE8 - AttributeError: 'Application' object has no attribute 'parse_preliminary_options' FAILED setup.py::flake-8::FLAKE8 - AttributeError: 'Application' object has no attribute 'parse_preliminary_options' FAILED test_flake8.py::flake-8::FLAKE8 - AttributeError: 'Application' object has no attribute 'parse_preliminary_options' FAILED test_flake8.py::TestIgnores::test_default_flake8_ignores - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} FAILED test_flake8.py::TestIgnores::test_ignores_all - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} FAILED test_flake8.py::TestIgnores::test_w293w292 - Failed: nomatch: '*W293*' FAILED test_flake8.py::TestIgnores::test_mtime_caching - Failed: nomatch: '*W293*' FAILED test_flake8.py::test_ok_verbose - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} FAILED test_flake8.py::test_keyword_match - Failed: nomatch: '*E201*' FAILED test_flake8.py::test_run_on_init_file - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} FAILED test_flake8.py::test_junit_classname - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} ========================================================================== 11 failed, 4 passed, 1 xfailed in 3.18s ========================================================================== ```

Please let me know if you need full pytest output.

Et7f3 commented 5 months ago

I did the PR when latest pytest was 7.2.0 Have you tested with this version ? Or your tested with 8.1.1 ? At the time of my PR it allowed to have a more recent range of dependencies but maybe it need another PR to target latest (would prefer to have it merged if it improve the current status and maybe I will do another PR)

kloczek commented 5 months ago

I did the PR when latest pytest was 7.2.0 Have you tested with this version ?

Nope. I've tested that using latest pytest 8.1.1 😋

j-rivero commented 5 months ago

As part of the works for the next Ubuntu Noble version under https://bugs.launchpad.net/ubuntu/+source/python-pytest-flake8/+bug/2058914 my teammate @clalancette made a path that I've verified can work with:

Patch against 1.1.1 is at https://github.com/tholo/pytest-flake8/compare/1.1.1...clalancette:pytest-flake8:modern-flake8

jaraco commented 1 month ago

Please consider contributing this fix or others to the revived project at coherent-oss.