-
-
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
Deprecate pytest namespace #3735
Deprecate pytest namespace #3735
Conversation
This hook has been deprecated and will be removed in the future. Fix pytest-dev#2639
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.
great 👍
src/_pytest/hookspec.py
Outdated
.. warning:: | ||
This hook has been **deprecated** and will be removed in pytest 4.0. | ||
|
||
Plugins who need this feature are suggested |
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 propose to align this somewhere along
Plugins whose users depend on the current name-space functionality should prepare to migrate to a namespace they actually own.
To support the migration its suggested to trigger `DeprecationWarnings` for objects they put into the pytest namespace.
An stopgap measure to avoid the warning is to monkeypatch the `pytest` module.
but just as the `pytest_namespace` hook this should be seen as a temporary measure to be removed.
simply to avoid accidentally declaring monkeypatching ´pytest` fine
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.
Sure will do
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.
Done
the base dance removed the already merged commits, i'm puzzled as to why its not more easy |
Yeah it should detect that automatically. |
src/_pytest/hookspec.py
Outdated
@hookspec(historic=True) | ||
@hookspec( | ||
historic=True, | ||
warn_on_impl=RemovedInPytest4Warning( |
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 just noticed that we didn't declare this one in the deprecated module, lets please move the actual declaration there
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.
Ooops good catch!
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.
Done 👍
This is based on #3732, so it is better to review after that PR gets merged.
Fix #2639