diff --git a/_pytest/fixtures.py b/_pytest/fixtures.py index 9196e4fdd..0116890c2 100644 --- a/_pytest/fixtures.py +++ b/_pytest/fixtures.py @@ -52,8 +52,6 @@ def pytest_namespace(): 'function': pytest.Item, }) return { - 'fixture': fixture, - 'yield_fixture': yield_fixture, 'collect': {'_fillfuncargs': fillfixtures} } diff --git a/_pytest/recwarn.py b/_pytest/recwarn.py index 579439fe4..43d360736 100644 --- a/_pytest/recwarn.py +++ b/_pytest/recwarn.py @@ -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``. diff --git a/pytest.py b/pytest.py index d9073f01c..aca96c143 100644 --- a/pytest.py +++ b/pytest.py @@ -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