typeddjango/pytest-mypy-plugins

ERROR pytest.PytestRemovedIn8Warning: The (fspath: py.path.local) argument to YamlTestFile is deprecated. Please use the (path: pathlib.Path) argument instead.

lovasoa opened this issue · 2 comments

Hello !

It looks like this library is using a deprecated pytest function argument, that makes tests fail when warnings are not allowed in the testsuite.

See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path

==================================== ERRORS ====================================
______________________ ERROR collecting tests/__init__.py ______________________
/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/pluggy/_hooks.py:265: in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/pluggy/_manager.py:80: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/pytest_mypy_plugins/collect.py:143: in pytest_collect_file
    return YamlTestFile.from_parent(parent, fspath=path)
/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/_pytest/nodes.py:630: in from_parent
    return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)
/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/_pytest/nodes.py:261: in from_parent
    return cls._create(parent=parent, **kw)
/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/_pytest/nodes.py:140: in _create
    return super().__call__(*k, **kw)
/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/_pytest/nodes.py:585: in __init__
    path = _imply_path(type(self), path, fspath=fspath)
/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/_pytest/nodes.py:114: in _imply_path
    stacklevel=3,
E   pytest.PytestRemovedIn8Warning: The (fspath: py.path.local) argument to YamlTestFile 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
=========================== short test summary info ============================
ERROR tests/__init__.py - pytest.PytestRemovedIn8Warning: The (fspath: py.pat...
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.15s ===============================

PR is more than welcome! Please, feel free to ask any questions 🙂

Doesn't seem like 7.0 was formally released yet. PyPI has only RC at the moment https://pypi.org/project/pytest/#history