remove pytest_namespace from recwarn and fixture decorators
This commit is contained in:
parent
794fd5658c
commit
c74103f395
|
@ -52,8 +52,6 @@ def pytest_namespace():
|
|||
'function': pytest.Item,
|
||||
})
|
||||
return {
|
||||
'fixture': fixture,
|
||||
'yield_fixture': yield_fixture,
|
||||
'collect': {'_fillfuncargs': fillfixtures}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,11 +26,6 @@ def recwarn():
|
|||
yield wrec
|
||||
|
||||
|
||||
def pytest_namespace():
|
||||
return {'deprecated_call': deprecated_call,
|
||||
'warns': warns}
|
||||
|
||||
|
||||
def deprecated_call(func=None, *args, **kwargs):
|
||||
""" assert that calling ``func(*args, **kwargs)`` triggers a
|
||||
``DeprecationWarning`` or ``PendingDeprecationWarning``.
|
||||
|
|
|
@ -12,6 +12,10 @@ __all__ = [
|
|||
'register_assert_rewrite',
|
||||
'freeze_includes',
|
||||
'set_trace',
|
||||
'warns',
|
||||
'deprecated_call',
|
||||
'fixture',
|
||||
'yield_fixture'
|
||||
]
|
||||
|
||||
if __name__ == '__main__': # if run as a script or by 'python -m pytest'
|
||||
|
@ -25,11 +29,12 @@ from _pytest.config import (
|
|||
main, UsageError, _preloadplugins, cmdline,
|
||||
hookspec, hookimpl
|
||||
)
|
||||
from _pytest.fixtures import fixture, yield_fixture
|
||||
from _pytest.assertion import register_assert_rewrite
|
||||
from _pytest.freeze_support import freeze_includes
|
||||
from _pytest import __version__
|
||||
from _pytest.debugging import pytestPDB as __pytestPDB
|
||||
|
||||
from _pytest.recwarn import warns, deprecated_call
|
||||
|
||||
|
||||
set_trace = __pytestPDB.set_trace
|
||||
|
|
Loading…
Reference in New Issue