-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Pathlib /tests/conftest.py #6290
Conversation
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.
I think this can be fixed in a nicer way: According to the reference docs, the pytest_ignore_collect
hook has a fspath
argument which you can use instead of path
. That will mean fspath
is a pathlib.Path
object as well.
@The-Compiler
Doesnt seems like the pahlib changes made it in 6.2.X :( |
Yep, you're right - they were added on December 15th and I blindly assumed there was a release since then, but the last feature release was on December 12th... Looks like there are some issues with that change still, see pytest-dev/pytest#8361 and pytest-dev/pytest#8463. Would you mind changing this to use the py.path API in the meantime? I don't think it makes much sense to convert from py.path to str to pathlib and back here until pytest is ready. |
I apologise for the inconvenience, just wrap up the path into a pathlib path for now |
No worries! But you're right, let's do something like |
The canonical api is os.fspath, i believe pathlib calls it, so Str should not be needed |
Looks great now, thanks! 👍 |
#176