pytest-flake8 icon indicating copy to clipboard operation
pytest-flake8 copied to clipboard

Make it compatible with latest flake8

Open Et7f3 opened this issue 2 years ago • 5 comments

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

Et7f3 avatar Apr 18 '23 00:04 Et7f3

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

Here is pytest output:
+ 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.

kloczek avatar Mar 15 '24 19:03 kloczek

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)

Et7f3 avatar Mar 17 '24 21:03 Et7f3

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 😋

kloczek avatar Mar 17 '24 23:03 kloczek

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:

  • flake8 7.0.0-1 (probably any version above 6 could work)
  • pytest 7.4.4-1 and pytest 8.0.2-1

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

j-rivero avatar Apr 02 '24 15:04 j-rivero

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

jaraco avatar Jul 19 '24 09:07 jaraco