pytest-dev/pytest-cpp

Getting some warnings with pytest 7.0

varunsh-xilinx opened this issue ยท 2 comments

After installing the plugin and running the tests, I had the following warnings printed out after the run:

../../../../usr/local/lib/python3.6/dist-packages/_pytest/nodes.py:148
../../../../usr/local/lib/python3.6/dist-packages/_pytest/nodes.py:148
../../../../usr/local/lib/python3.6/dist-packages/_pytest/nodes.py:148
../../../../usr/local/lib/python3.6/dist-packages/_pytest/nodes.py:148
../../../../usr/local/lib/python3.6/dist-packages/_pytest/nodes.py:148
  /usr/local/lib/python3.6/dist-packages/_pytest/nodes.py:148: PytestDeprecationWarning: <class 'pytest_cpp.plugin.CppFile'> is not using a cooperative constructor and only takes {'parent', 'facade', 'fspath', 'arguments'}.
  See https://docs.pytest.org/en/stable/deprecations.html#constructors-of-custom-pytest-node-subclasses-should-take-kwargs for more details.
    f"{self} is not using a cooperative constructor and only takes {set(known_kw)}.\n"

../../../../usr/local/lib/python3.6/dist-packages/pytest_cpp/plugin.py:98
../../../../usr/local/lib/python3.6/dist-packages/pytest_cpp/plugin.py:98
../../../../usr/local/lib/python3.6/dist-packages/pytest_cpp/plugin.py:98
../../../../usr/local/lib/python3.6/dist-packages/pytest_cpp/plugin.py:98
../../../../usr/local/lib/python3.6/dist-packages/pytest_cpp/plugin.py:98
  /usr/local/lib/python3.6/dist-packages/pytest_cpp/plugin.py:98: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to CppFile 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
    pytest.File.__init__(self, fspath, parent)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

I'm using pytest-cpp 2.1.1 with Python 3.6.9. I've filtered the deprecation warnings out so it's not a huge issue but would be good to fix.

Thanks for the report, but this is actually due to pytest 7.0.

We should fix this in pytest-cpp. ๐Ÿ‘

2.1.2 released ๐ŸŽ‰

Thanks again for the report. ๐Ÿ‘