Merge pull request #2636 from RonnyPfannschmidt/remove-preinit
remove preinit, its no longer needed
This commit is contained in:
commit
6e7547244b
|
@ -100,8 +100,6 @@ def directory_arg(path, optname):
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
_preinit = []
|
|
||||||
|
|
||||||
default_plugins = (
|
default_plugins = (
|
||||||
"mark main terminal runner python fixtures debugging unittest capture skipping "
|
"mark main terminal runner python fixtures debugging unittest capture skipping "
|
||||||
"tmpdir monkeypatch recwarn pastebin helpconfig nose assertion "
|
"tmpdir monkeypatch recwarn pastebin helpconfig nose assertion "
|
||||||
|
@ -113,14 +111,7 @@ builtin_plugins = set(default_plugins)
|
||||||
builtin_plugins.add("pytester")
|
builtin_plugins.add("pytester")
|
||||||
|
|
||||||
|
|
||||||
def _preloadplugins():
|
|
||||||
assert not _preinit
|
|
||||||
_preinit.append(get_config())
|
|
||||||
|
|
||||||
|
|
||||||
def get_config():
|
def get_config():
|
||||||
if _preinit:
|
|
||||||
return _preinit.pop(0)
|
|
||||||
# subsequent calls to main will create a fresh instance
|
# subsequent calls to main will create a fresh instance
|
||||||
pluginmanager = PytestPluginManager()
|
pluginmanager = PytestPluginManager()
|
||||||
config = Config(pluginmanager)
|
config = Config(pluginmanager)
|
||||||
|
|
|
@ -83,15 +83,6 @@ def pytest_addoption(parser):
|
||||||
help="base temporary directory for this test run.")
|
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):
|
def pytest_configure(config):
|
||||||
__import__('pytest').config = config # compatibiltiy
|
__import__('pytest').config = config # compatibiltiy
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
- Remove internal ``_preloadplugins()`` function. This removal is part of the ``pytest_namespace()`` hook deprecation.
|
|
@ -7,7 +7,7 @@ pytest: unit and functional testing with Python.
|
||||||
# else we are imported
|
# else we are imported
|
||||||
|
|
||||||
from _pytest.config import (
|
from _pytest.config import (
|
||||||
main, UsageError, _preloadplugins, cmdline,
|
main, UsageError, cmdline,
|
||||||
hookspec, hookimpl
|
hookspec, hookimpl
|
||||||
)
|
)
|
||||||
from _pytest.fixtures import fixture, yield_fixture
|
from _pytest.fixtures import fixture, yield_fixture
|
||||||
|
@ -74,5 +74,4 @@ if __name__ == '__main__':
|
||||||
else:
|
else:
|
||||||
|
|
||||||
from _pytest.compat import _setup_collect_fakemodule
|
from _pytest.compat import _setup_collect_fakemodule
|
||||||
_preloadplugins() # to populate pytest.* namespace so help(pytest) works
|
|
||||||
_setup_collect_fakemodule()
|
_setup_collect_fakemodule()
|
||||||
|
|
Loading…
Reference in New Issue