Skip to content

[CI] Deprecations in pytest==7.0.0 make tests fail #3079

@abravalheri

Description

@abravalheri

Pytest 7 that just came out a few hours ago is currently issuing a deprecation warning for pytest-flake8, which makes setuptools tests to fail:

$ tox
...
...
E   pytest.PytestDeprecationWarning: <class 'pytest_flake8.Flake8Item'> is not using a cooperative constructor and only takes {'fspath', 'parent'}.
E   See https://docs.pytest.org/en/stable/deprecations.html#constructors-of-custom-pytest-node-subclasses-should-take-kwargs for more details.
...
...
E   pytest.PytestRemovedIn8Warning: The (fspath: py.path.local) argument to Flake8Item is deprecated. Please use the (path: pathlib.Path) argument instead.
E   See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path

This problem seems to be already reported in the project issue tracker: tholo/pytest-flake8#83.

As a temporary workaround I believe we can take one of the following approaches:

  1. Ignore those specific warnings in pytest.ini
  2. Disable temporarily pytest-flake8
  3. Add a version cap to the pytest test dependency.

Probably the first approach is the most straight forward?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions