Skip to content

docs: Create links for objects to show the api #2473

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

Merged
merged 2 commits into from
Jun 6, 2017
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
6 changes: 3 additions & 3 deletions _pytest/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _prepareconfig(args=None, plugins=None):

class PytestPluginManager(PluginManager):
"""
Overwrites :py:class:`pluggy.PluginManager` to add pytest-specific
Overwrites :py:class:`pluggy.PluginManager <_pytest.vendored_packages.pluggy.PluginManager>` to add pytest-specific
functionality:

* loading plugins from the command line, ``PYTEST_PLUGIN`` env variable and
Expand Down Expand Up @@ -206,7 +206,7 @@ def addhooks(self, module_or_class):
"""
.. deprecated:: 2.8

Use :py:meth:`pluggy.PluginManager.add_hookspecs` instead.
Use :py:meth:`pluggy.PluginManager.add_hookspecs <_pytest.vendored_packages.pluggy.PluginManager.add_hookspecs>` instead.
"""
warning = dict(code="I2",
fslocation=_pytest._code.getfslineno(sys._getframe(1)),
Expand Down Expand Up @@ -1130,7 +1130,7 @@ def addinivalue_line(self, name, line):
def getini(self, name):
""" return configuration value from an :ref:`ini file <inifiles>`. If the
specified name hasn't been registered through a prior
:py:func:`parser.addini <pytest.config.Parser.addini>`
:py:func:`parser.addini <_pytest.config.Parser.addini>`
call (usually from a plugin), a ValueError is raised. """
try:
return self._inicache[name]
Expand Down
2 changes: 1 addition & 1 deletion _pytest/hookspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def pytest_runtest_teardown(item, nextitem):
@hookspec(firstresult=True)
def pytest_runtest_makereport(item, call):
""" return a :py:class:`_pytest.runner.TestReport` object
for the given :py:class:`pytest.Item` and
for the given :py:class:`pytest.Item <_pytest.main.Item>` and
:py:class:`_pytest.runner.CallInfo`.
"""

Expand Down
2 changes: 1 addition & 1 deletion _pytest/vendored_packages/pluggy.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def add_hookcall_monitoring(self, before, after):
of HookImpl instances and the keyword arguments for the hook call.

``after(outcome, hook_name, hook_impls, kwargs)`` receives the
same arguments as ``before`` but also a :py:class:`_CallOutcome`` object
same arguments as ``before`` but also a :py:class:`_CallOutcome <_pytest.vendored_packages.pluggy._CallOutcome>` object
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should be applied in the upstream repository at pytest-dev/pluggy instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the real problem is, that we change the absolute path, there - the whole thing is incorrect unless we stop vendoring

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the whole thing" you mean the entire PR? I don't think so, only the change in pluggy needs to be dropped, the other links work fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicoddemus what i mean is that the pluggy details we include in the docs go wrong because we change the absolute name of everything inside pluggy due to vendoring (so the change to pluggy is correct for the context of making the pytest docs correct, but it breaks vendoring

which represents the result of the overall hook call.
"""
return _TracedHookExecution(self, before, after).undo
Expand Down
1 change: 1 addition & 0 deletions changelog/2331.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix internal API links to ``pluggy`` objects.
6 changes: 3 additions & 3 deletions doc/en/writing_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,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` instance which encapsulates a result or
a :py:class:`CallOutcome <_pytest.vendored_packages.pluggy._CallOutcome>` instance which encapsulates a result or
exception info. The yield point itself will thus typically not raise
exceptions (unless there are bugs).

Expand Down Expand Up @@ -448,7 +448,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` instance which encapsulates
point. The yield receives a :py:class:`CallOutcome <_pytest.vendored_packages.pluggy._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
Expand Down Expand Up @@ -525,7 +525,7 @@ Initialization, command line and configuration hooks
Generic "runtest" hooks
-----------------------

All runtest related hooks receive a :py:class:`pytest.Item` object.
All runtest related hooks receive a :py:class:`pytest.Item <_pytest.main.Item>` object.

.. autofunction:: pytest_runtest_protocol
.. autofunction:: pytest_runtest_setup
Expand Down