summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2017-07-31 11:10:29 +0200
committerRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2017-07-31 13:44:05 +0200
commitc68a89b4a78a4bd4ab5ab1b139f9fe5b002bdad8 (patch)
tree22d9d11f2cfad08927b1a23468c5e87843911423
parentf1467f8f0385c17c02524b70e0bac949d4dbd116 (diff)
downloadpytest-c68a89b4a78a4bd4ab5ab1b139f9fe5b002bdad8.tar.gz
remove preinit, its no longer needed
-rw-r--r--_pytest/config.py9
-rw-r--r--changelog/2236.removal1
-rw-r--r--pytest.py3
3 files changed, 2 insertions, 11 deletions
diff --git a/_pytest/config.py b/_pytest/config.py
index d0ec62096..bdfe99b99 100644
--- a/_pytest/config.py
+++ b/_pytest/config.py
@@ -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 "
@@ -113,14 +111,7 @@ builtin_plugins = set(default_plugins)
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)
diff --git a/changelog/2236.removal b/changelog/2236.removal
new file mode 100644
index 000000000..013327291
--- /dev/null
+++ b/changelog/2236.removal
@@ -0,0 +1 @@
+- remove plugin preinit, we no longer need to do that because the namespace is initialized in the module now \ No newline at end of file
diff --git a/pytest.py b/pytest.py
index 1c914a6ed..2b681b64b 100644
--- a/pytest.py
+++ b/pytest.py
@@ -7,7 +7,7 @@ pytest: unit and functional testing with Python.
# else we are imported
from _pytest.config import (
- main, UsageError, _preloadplugins, cmdline,
+ main, UsageError, cmdline,
hookspec, hookimpl
)
from _pytest.fixtures import fixture, yield_fixture
@@ -74,5 +74,4 @@ if __name__ == '__main__':
else:
from _pytest.compat import _setup_collect_fakemodule
- _preloadplugins() # to populate pytest.* namespace so help(pytest) works
_setup_collect_fakemodule()