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
Update path argument #89
Conversation
pytest_mypy_plugins/collect.py
Outdated
def pytest_collect_file(file_path: pathlib.Path, parent: Node) -> Optional[YamlTestFile]: | ||
if file_path.suffix in {".yaml", ".yml"} and file_path.name.startswith(("test-", "test_")): | ||
return YamlTestFile.from_parent(parent, path=file_path) | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If only this part is implemented, pluggy
fails with:
pluggy._manager.PluginValidationError: Plugin 'pytest-mypy-plugins' for hook 'pytest_collect_file'
hookimpl definition: pytest_collect_file(file_path: pathlib.Path, parent: _pytest.nodes.Node) -> Optional[pytest_mypy_plugins.collect.YamlTestFile]
Argument(s) {'file_path'} are declared in the hookimpl but can not be found in the hookspec
652919d
to
0f3e4df
Compare
787cafd
to
ed83060
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you!
Do we need some additional test cases with pytest==7.0
and pytest<7.0
?
For starters, I am thinking about adding a matrix of Beyond that, I am not sure TBH. Initially I completely missed |
Huh, so it seems like it is unrelated to issue |
6ca0a32
to
b349993
Compare
Anything else? It is still marked as WIP 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Great work!
Yay, this is cool. It's causing an issue in the test framework for one of lovasoa's repositories which has also been bothering me for a while, and blocking a pull request which would fix it. It doesn't look like there's been a release since this branch was merged, do you know when we might get one? :) |
Today! 🙂 |
Done! https://pypi.org/project/pytest-mypy-plugins/1.9.3/ Thanks for the reminder. |
This PR introduces compatibility with pytest 7.0.0rc1. As described in the link included in the original issue.
fspath
withLocalPath
is deprecated in favor ofpath
withpathlib.Path
.Closes #88