From 66009b0f913007613f3a0cd094d4431d6e9d21ad Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 27 Feb 2018 17:58:51 -0300 Subject: [PATCH] Add tutorial links to all references --- doc/en/example/simple.rst | 2 ++ doc/en/reference.rst | 25 +++++++++++++++++++++++-- doc/en/usage.rst | 2 ++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 8a2a92bf6..1b1cb829c 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -3,6 +3,8 @@ Basic patterns and examples ========================================================== +.. _request example: + Pass different values to a test function, depending on command line options ---------------------------------------------------------------------------- diff --git a/doc/en/reference.rst b/doc/en/reference.rst index e8cf441fa..dd77c126c 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -54,14 +54,16 @@ pytest.main pytest.raises ------------- +**Tutorial**: :ref:`assertraises`. + .. autofunction:: _pytest.python_api.raises :with: excinfo -Examples at :ref:`assertraises`. - pytest.deprecated_call ---------------------- +**Tutorial**: :ref:`ensuring_function_triggers`. + .. autofunction:: _pytest.recwarn.deprecated_call :with: @@ -70,6 +72,7 @@ pytest.deprecated_call Hooks ----- +**Tutorial**: :doc:`writing_plugins`. .. currentmodule:: _pytest.hookspec @@ -265,6 +268,8 @@ Full reference to objects accessible from :ref:`fixtures ` or hooks Fixtures -------- +**Tutorial**: :ref:`fixture`. + Fixtures are requested by test functions or other fixtures by declaring them as argument names. @@ -303,6 +308,8 @@ fixture decorator config.cache ~~~~~~~~~~~~ +**Tutorial**: :ref:`cache`. + The ``config.cache`` object allows other plugins and fixtures to store and retrieve values across test runs. To access it from fixtures request ``pytestconfig`` into your fixture and get it with ``pytestconfig.cache``. @@ -320,6 +327,8 @@ Under the hood, the cache plugin uses the simple capsys ~~~~~~ +**Tutorial**: :doc:`capture`. + .. currentmodule:: _pytest.capture .. autofunction:: capsys() @@ -340,6 +349,8 @@ capsys capsysbinary ~~~~~~~~~~~~ +**Tutorial**: :doc:`capture`. + .. autofunction:: capsysbinary() :no-auto-options: @@ -358,6 +369,8 @@ capsysbinary capfd ~~~~~~ +**Tutorial**: :doc:`capture`. + .. autofunction:: capfd() :no-auto-options: @@ -376,6 +389,8 @@ capfd capfdbinary ~~~~~~~~~~~~ +**Tutorial**: :doc:`capture`. + .. autofunction:: capfdbinary() :no-auto-options: @@ -394,6 +409,8 @@ capfdbinary doctest_namespace ~~~~~~~~~~~~~~~~~ +**Tutorial**: :doc:`doctest`. + .. autofunction:: _pytest.doctest.doctest_namespace() Usually this fixture is used in conjunction with another ``autouse`` fixture: @@ -410,6 +427,8 @@ doctest_namespace request ~~~~~~~ +**Tutorial**: :ref:`request example`. + The ``request`` fixture is a special fixture providing information of the requesting test function. .. autoclass:: _pytest.fixtures.FixtureRequest() @@ -425,6 +444,8 @@ pytestconfig record_xml_property ~~~~~~~~~~~~~~~~~~~ +**Tutorial**: :ref:`record_xml_property example`. + .. autofunction:: _pytest.junitxml.record_xml_property() caplog diff --git a/doc/en/usage.rst b/doc/en/usage.rst index abd8bac2b..4b2c49c31 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -220,6 +220,8 @@ To set the name of the root test suite xml item, you can configure the ``junit_s [pytest] junit_suite_name = my_suite +.. _record_xml_property example: + record_xml_property ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^