-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix fspath warnings in nonpython.rst example #8821
Comments
So I'm looking at #8840 and using a private pytest helper in an example seems like an odd thing to me. After all, we'd want users to be able to do this kind of thing without having to reach into pytest internals... I see there's a TODO about it in 77cb110 - but now we're in a situation where What to do about this? I can see a couple of ways forward:
path, line, _name = super().reportinfo()
return path, line, f"usecase: {self.name}" cc @RonnyPfannschmidt @bluetech @nicoddemus because I think those were involved in the pathlib migration mostly. |
FWIW, this is what I think we should do. I think the py.path deprecations should all be done in one shot with proper documentation, guidance, migration plan etc. which is not ready yet. See #7259 for discussion. Unfortunately I haven't had time to work on it this last month. |
( |
Let's defer the warning |
I like that one actually, because it is future proof. But I agree we should defer the warning until pytest itself is sorted out and we have complete documentation on how users can do it. |
It is not compatible for users/plugins which call |
Ahh true. |
Is this really something we should have to worry about? I did a quick search in my almost complete corpus of plugins, and found:
The pytest-cases one is commented out (and only does A grep.app search is similarly boring and mostly shows vendored pytest copies. Not sure if it gets used somewhere indirectly - but if it is, pytest could still turn the value into a legacy path for that. (Decided to keep the discussion in here for now, as this issue is specifically about what to do with |
@The-Compiler according to this analysis, it seems like the way to go as the breakage (if any) will be minimal -- when I thought about it (not too much) I couldn't think of a nice way to do this in a backward compatible way. Ideally we'd get rid of |
Yeah, and I feel like this is out of scope for 7.0 - right now I'd really like to focus on picking up the lose ends of whatever (great!) work we've done so far, so that we can finally get to another release. So what's the way forward here? However, this means plugins implementing def reportinfo():
try:
path = self.path
except AttributeError:
path = self.fspath (or the |
I agree with removing the warning: that simple to do and we can reintroduce the warning later once we have a clear solution moving forward. If everybody agrees I can work on a PR. |
It is not clear yet how we should proceed with this deprecation because `pytest.Item.reportinfo` is public API and returns a `py.path` object, and is not clear how plugins and our examples should handle that. Reverting just the deprecation aspect of pytest-dev#8251 so we can get a 7.0.0 release out. We will reintroduce the deprecation later once we have a clear path moving forward with replacing `reportinfo`. Closes pytest-dev#8445 Closes pytest-dev#8821
It is not clear yet how we should proceed with this deprecation because `pytest.Item.reportinfo` is public API and returns a `py.path` object, and is not clear how plugins and our examples should handle that. Reverting just the deprecation aspect of pytest-dev#8251 so we can get a 7.0.0 release out. We will reintroduce the deprecation later once we have a clear path moving forward with replacing `reportinfo`. Closes pytest-dev#8445 Closes pytest-dev#8821
It is not clear yet how we should proceed with this deprecation because `pytest.Item.reportinfo` is public API and returns a `py.path` object, and is not clear how plugins and our examples should handle that. Reverting just the deprecation aspect of pytest-dev#8251 so we can get a 7.0.0 release out. We will reintroduce the deprecation later once we have a clear path moving forward with replacing `reportinfo`. Closes pytest-dev#8445 Closes pytest-dev#8821
Looks like something we should fix in the example
Originally posted by @The-Compiler in #8814 (comment)
The text was updated successfully, but these errors were encountered: