Move warning definition to deprecated module

This commit is contained in:
Bruno Oliveira 2018-07-30 14:25:29 -03:00
parent 953a618102
commit 8609f8d25a
2 changed files with 7 additions and 7 deletions

View File

@ -71,3 +71,7 @@ PYTEST_PLUGINS_FROM_NON_TOP_LEVEL_CONFTEST = RemovedInPytest4Warning(
"because it affects the entire directory tree in a non-explicit way.\n" "because it affects the entire directory tree in a non-explicit way.\n"
"Please move it to the top level conftest file instead." "Please move it to the top level conftest file instead."
) )
PYTEST_NAMESPACE = RemovedInPytest4Warning(
"pytest_namespace is deprecated and will be removed soon"
)

View File

@ -1,7 +1,8 @@
""" hook specifications for pytest plugins, invoked from main.py and builtin plugins. """ """ hook specifications for pytest plugins, invoked from main.py and builtin plugins. """
from pluggy import HookspecMarker from pluggy import HookspecMarker
from .deprecated import RemovedInPytest4Warning from .deprecated import PYTEST_NAMESPACE
hookspec = HookspecMarker("pytest") hookspec = HookspecMarker("pytest")
@ -23,12 +24,7 @@ def pytest_addhooks(pluginmanager):
""" """
@hookspec( @hookspec(historic=True, warn_on_impl=PYTEST_NAMESPACE)
historic=True,
warn_on_impl=RemovedInPytest4Warning(
"pytest_namespace is deprecated and will be removed soon"
),
)
def pytest_namespace(): def pytest_namespace():
""" """
return dict of name->object to be made globally available in return dict of name->object to be made globally available in