diff --git a/_pytest/fixtures.py b/_pytest/fixtures.py index 621e38057..16481ca1c 100644 --- a/_pytest/fixtures.py +++ b/_pytest/fixtures.py @@ -19,6 +19,11 @@ from _pytest.compat import ( ) def pytest_sessionstart(session): + scopename2class.update({ + 'class': pytest.Class, + 'module': pytest.Module, + 'function': pytest.Item, + }) session._fixturemanager = FixtureManager(session) @@ -45,15 +50,6 @@ def scopeproperty(name=None, doc=None): return decoratescope -def pytest_namespace(): - scopename2class.update({ - 'class': pytest.Class, - 'module': pytest.Module, - 'function': pytest.Item, - }) - return {} - - def get_scope_node(node, scope): cls = scopename2class.get(scope) if cls is None: