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

New deprecation warning with pytest 8.1 (YamlTestFile not using a cooperative constructor) #142

Open
tlambert03 opened this issue Mar 4, 2024 · 2 comments

Comments

@tlambert03
Copy link

_______________________________________________ ERROR collecting typesafety ________________________________________________
.venv/lib/python3.12/site-packages/_pytest/nodes.py:87: in _create
    return super().__call__(*k, **kw)  # type: ignore[no-any-return,misc]
E   TypeError: FSCollector.__init__() got an unexpected keyword argument 'fspath'

During handling of the above exception, another exception occurred:
.venv/lib/python3.12/site-packages/pluggy/_hooks.py:501: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
.venv/lib/python3.12/site-packages/pluggy/_manager.py:119: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
.venv/lib/python3.12/site-packages/pytest_mypy_plugins/collect.py:181: in pytest_collect_file
    return YamlTestFile.from_parent(parent, path=file_path, fspath=None)
.venv/lib/python3.12/site-packages/_pytest/nodes.py:592: in from_parent
    return super().from_parent(parent=parent, path=path, **kw)
.venv/lib/python3.12/site-packages/_pytest/nodes.py:203: in from_parent
    return cls._create(parent=parent, **kw)
.venv/lib/python3.12/site-packages/_pytest/nodes.py:93: in _create
    warnings.warn(
E   pytest.PytestDeprecationWarning: <class 'pytest_mypy_plugins.collect.YamlTestFile'> is not using a cooperative constructor and only takes {'parent', 'path'}.
E   See https://docs.pytest.org/en/stable/deprecations.html#constructors-of-custom-pytest-node-subclasses-should-take-kwargs for more details.
@sobolevn
Copy link
Member

sobolevn commented Mar 4, 2024

PR is welcome :)

@tlambert03
Copy link
Author

will do if I have time! I don't know the first thing about this sort of pytest plugin :)
was reporting as a courtesy. it's definitely not a big deal (i can silence the warnings locally).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants