diff --git a/_pytest/_pluggy.py b/_pytest/_pluggy.py deleted file mode 100644 index 0cb4a4fb4..000000000 --- a/_pytest/_pluggy.py +++ /dev/null @@ -1,6 +0,0 @@ -""" -Import symbols from ``pluggy`` -""" -from __future__ import absolute_import, division, print_function -from pluggy import * -from pluggy import __version__ diff --git a/_pytest/config.py b/_pytest/config.py index 2fcbe9a09..fd295fc73 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -14,7 +14,7 @@ import os import _pytest._code import _pytest.hookspec # the extension point definitions import _pytest.assertion -from _pytest._pluggy import PluginManager, HookimplMarker, HookspecMarker +from pluggy import PluginManager, HookimplMarker, HookspecMarker from _pytest.compat import safe_str hookimpl = HookimplMarker("pytest") @@ -165,7 +165,7 @@ def _prepareconfig(args=None, plugins=None): class PytestPluginManager(PluginManager): """ - Overwrites :py:class:`pluggy.PluginManager <_pytest._pluggy.PluginManager>` to add pytest-specific + Overwrites :py:class:`pluggy.PluginManager ` to add pytest-specific functionality: * loading plugins from the command line, ``PYTEST_PLUGIN`` env variable and @@ -203,7 +203,7 @@ class PytestPluginManager(PluginManager): """ .. deprecated:: 2.8 - Use :py:meth:`pluggy.PluginManager.add_hookspecs <_pytest._pluggy.PluginManager.add_hookspecs>` + Use :py:meth:`pluggy.PluginManager.add_hookspecs ` instead. """ warning = dict(code="I2", diff --git a/_pytest/hookspec.py b/_pytest/hookspec.py index e5c966e58..93cf91b78 100644 --- a/_pytest/hookspec.py +++ b/_pytest/hookspec.py @@ -1,6 +1,6 @@ """ hook specifications for pytest plugins, invoked from main.py and builtin plugins. """ -from _pytest._pluggy import HookspecMarker +from pluggy import HookspecMarker hookspec = HookspecMarker("pytest") diff --git a/_pytest/python.py b/_pytest/python.py index b79486267..e3d79b2e9 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -15,7 +15,7 @@ from _pytest.mark import MarkerError from _pytest.config import hookimpl import _pytest -import _pytest._pluggy as pluggy +import pluggy from _pytest import fixtures from _pytest import main from _pytest.compat import ( diff --git a/_pytest/terminal.py b/_pytest/terminal.py index 0a023d1f3..f7304f1e7 100644 --- a/_pytest/terminal.py +++ b/_pytest/terminal.py @@ -13,8 +13,7 @@ import six import sys import time import platform - -import _pytest._pluggy as pluggy +import pluggy def pytest_addoption(parser): diff --git a/doc/en/writing_plugins.rst b/doc/en/writing_plugins.rst index 6e96fe7c4..5f151b4bb 100644 --- a/doc/en/writing_plugins.rst +++ b/doc/en/writing_plugins.rst @@ -454,7 +454,7 @@ hook wrappers and passes the same arguments as to the regular hooks. At the yield point of the hook wrapper pytest will execute the next hook implementations and return their result to the yield point in the form of -a :py:class:`CallOutcome <_pytest._pluggy._CallOutcome>` instance which encapsulates a result or +a :py:class:`CallOutcome ` instance which encapsulates a result or exception info. The yield point itself will thus typically not raise exceptions (unless there are bugs). @@ -519,7 +519,7 @@ Here is the order of execution: Plugin1). 4. Plugin3's pytest_collection_modifyitems then executing the code after the yield - point. The yield receives a :py:class:`CallOutcome <_pytest._pluggy._CallOutcome>` instance which encapsulates + point. The yield receives a :py:class:`CallOutcome ` instance which encapsulates the result from calling the non-wrappers. Wrappers shall not modify the result. It's possible to use ``tryfirst`` and ``trylast`` also in conjunction with @@ -716,7 +716,7 @@ Reference of objects involved in hooks :members: :inherited-members: -.. autoclass:: _pytest._pluggy._CallOutcome() +.. autoclass:: pluggy._CallOutcome() :members: .. autofunction:: _pytest.config.get_plugin_manager() @@ -726,7 +726,7 @@ Reference of objects involved in hooks :undoc-members: :show-inheritance: -.. autoclass:: _pytest._pluggy.PluginManager() +.. autoclass:: pluggy.PluginManager() :members: .. currentmodule:: _pytest.pytester diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 6b20c3a48..9b03f4ce7 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -5,7 +5,7 @@ from __future__ import absolute_import, division, print_function import collections import sys -import _pytest._pluggy as pluggy +import pluggy import _pytest._code import py import pytest