Skip to content
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

remove preinit, its no longer needed #2636

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions _pytest/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ def directory_arg(path, optname):
return path


_preinit = []

default_plugins = (
"mark main terminal runner python fixtures debugging unittest capture skipping "
"tmpdir monkeypatch recwarn pastebin helpconfig nose assertion "
Expand All @@ -113,14 +111,7 @@ def directory_arg(path, optname):
builtin_plugins.add("pytester")


def _preloadplugins():
assert not _preinit
_preinit.append(get_config())


def get_config():
if _preinit:
return _preinit.pop(0)
# subsequent calls to main will create a fresh instance
pluginmanager = PytestPluginManager()
config = Config(pluginmanager)
Expand Down
9 changes: 0 additions & 9 deletions _pytest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,6 @@ def pytest_addoption(parser):
help="base temporary directory for this test run.")


def pytest_namespace():
"""keeping this one works around a deeper startup issue in pytest

i tried to find it for a while but the amount of time turned unsustainable,
so i put a hack in to revisit later
"""
return {}


def pytest_configure(config):
__import__('pytest').config = config # compatibiltiy

Expand Down
1 change: 1 addition & 0 deletions changelog/2236.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove internal ``_preloadplugins()`` function. This removal is part of the ``pytest_namespace()`` hook deprecation.
3 changes: 1 addition & 2 deletions pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# else we are imported

from _pytest.config import (
main, UsageError, _preloadplugins, cmdline,
main, UsageError, cmdline,
hookspec, hookimpl
)
from _pytest.fixtures import fixture, yield_fixture
Expand Down Expand Up @@ -74,5 +74,4 @@
else:

from _pytest.compat import _setup_collect_fakemodule
_preloadplugins() # to populate pytest.* namespace so help(pytest) works
_setup_collect_fakemodule()