Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage no longer compatible with pytest 7 #83

Open
jaraco opened this issue Nov 7, 2021 · 3 comments
Open

Usage no longer compatible with pytest 7 #83

jaraco opened this issue Nov 7, 2021 · 3 comments

Comments

@jaraco
Copy link

jaraco commented Nov 7, 2021

See pytest-dev/pytest#8435 for background and jaraco/pytest-checkdocs#9 for an example of how I addressed the issue in pytest-checkdocs.

tsibley added a commit to nextstrain/cli that referenced this issue Feb 4, 2022
The warning was turned into an error by our pytest config, and thus
resulted in test failures.

There's an existing issue for pytest-flake8¹ that's 3 months old now
with no movement so far.  setuptools is also dealing with the same
warnings.²

If other issues arise that aren't fixed upstream, a longer term solution
could be doing what we do with mypy and simply invoke flake8 directly
instead of via a pytest plugin.

¹ tholo/pytest-flake8#83
² pypa/setuptools#3079
@jaraco
Copy link
Author

jaraco commented Feb 5, 2022

See jaraco/pytest-checkdocs#9 and jaraco/pytest-perf#5 for approaches I used to fix this issue.

DevL added a commit to funnel-io/python-on-rails that referenced this issue Feb 11, 2022
pytest-flake8 seems abandoned at this point

Related issues in other repositories:
* tholo/pytest-flake8#83
* miketheman/pytest-socket#82
@abravalheri
Copy link

The following warning/error also shows up with 7.0.1:

E   pytest.PytestWarning: Flake8Item is an Item subclass and should not be a collector, however its bases File are collectors.
E   Please split the Collectors and the Item into separate node types.
E   Pytest Doc example: https://docs.pytest.org/en/latest/example/nonpython.html
E   example pull request on a plugin: https://github.com/asmeurer/pytest-flakes/pull/40/

@akaihola
Copy link

akaihola commented Apr 1, 2022

With pytest-flake8==1.1.0 and pytest==7.0.0 I used to get these:

_pytest/nodes.py:146
  _pytest/nodes.py:146: PytestDeprecationWarning: <class 'pytest_flake8.Flake8Item'> is not using a cooperative constructor and only takes {'fspath', 'parent'}.
  See https://docs.pytest.org/en/stable/deprecations.html#constructors-of-custom-pytest-node-subclasses-should-take-kwargs for more details.
    warnings.warn(

_pytest/nodes.py:686
  _pytest/nodes.py:686: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to Flake8Item is deprecated. Please use the (path: pathlib.Path) argument instead.
  See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
    super().__init__(

After upgrading to pytest==7.1.1, I additionally see this one:

_pytest/nodes.py:708
  _pytest/nodes.py:708: PytestWarning: Flake8Item is an Item subclass and should not be a collector, however its bases File are collectors.
  Please split the Collectors and the Item into separate node types.
  Pytest Doc example: https://docs.pytest.org/en/latest/example/nonpython.html
  example pull request on a plugin: https://github.com/asmeurer/pytest-flakes/pull/40/
    warnings.warn(

But after upgrading to pytest-flake8==1.1.1 they all disappear.

Should this PR be closed, or are there some other remaining incompatibilities with Pytest 7.x which I'm just not hitting in my project?

living180 added a commit to living180/git-cola that referenced this issue Feb 14, 2023
pytest-flake8 has been broken for over a year with flake8 >= 5.0
[1][2][3], and has not had any commits since March 2022.  Drop in
favor of simply invoking flake8 separately outside of pytest.  Ensure
that "make check" now invokes flake8.

[1] tholo/pytest-flake8#83
[2] tholo/pytest-flake8#87
[3] tholo/pytest-flake8#92

Signed-off-by: Daniel Harding <dharding@living180.net>
living180 added a commit to living180/git-cola that referenced this issue Feb 14, 2023
pytest-flake8 has been broken for over a year with pytest >= 7.0 [1] and
more than six months with flake8 >= 5.0 [2][3], and has not had any
commits since March 2022.  Drop in favor of simply invoking flake8
separately outside of pytest.  Ensure that "make check" now invokes
flake8.

[1] tholo/pytest-flake8#83
[2] tholo/pytest-flake8#87
[3] tholo/pytest-flake8#92

Signed-off-by: Daniel Harding <dharding@living180.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants