Improve fixture reference a bit
This commit is contained in:
parent
69d49f18e9
commit
443888248a
|
@ -8,22 +8,19 @@ This page contains the full reference to pytest's API.
|
||||||
:depth: 3
|
:depth: 3
|
||||||
:local:
|
:local:
|
||||||
|
|
||||||
|
Functions
|
||||||
|
---------
|
||||||
|
|
||||||
pytest.approx
|
pytest.approx
|
||||||
-------------
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. autofunction:: _pytest.python_api.approx
|
.. autofunction:: _pytest.python_api.approx
|
||||||
|
|
||||||
outcomes
|
|
||||||
--------
|
|
||||||
|
|
||||||
You can use the following functions in your test, fixture or setup
|
|
||||||
functions to force a certain test outcome. Note that most often
|
|
||||||
you can rather use declarative marks, see :ref:`skipping`.
|
|
||||||
|
|
||||||
pytest.fail
|
pytest.fail
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Tutorial**: :ref:`skipping`
|
||||||
|
|
||||||
.. autofunction:: _pytest.outcomes.fail
|
.. autofunction:: _pytest.outcomes.fail
|
||||||
|
|
||||||
pytest.skip
|
pytest.skip
|
||||||
|
@ -42,22 +39,22 @@ pytest.xfail
|
||||||
.. autofunction:: _pytest.outcomes.xfail
|
.. autofunction:: _pytest.outcomes.xfail
|
||||||
|
|
||||||
pytest.exit
|
pytest.exit
|
||||||
-----------
|
~~~~~~~~~~~
|
||||||
|
|
||||||
.. autofunction:: _pytest.outcomes.exit
|
.. autofunction:: _pytest.outcomes.exit
|
||||||
|
|
||||||
pytest.main
|
pytest.main
|
||||||
-----------
|
~~~~~~~~~~~
|
||||||
|
|
||||||
.. autofunction:: _pytest.config.main
|
.. autofunction:: _pytest.config.main
|
||||||
|
|
||||||
pytest.param
|
pytest.param
|
||||||
------------
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. autofunction:: pytest.param(*values, [id], [marks])
|
.. autofunction:: pytest.param(*values, [id], [marks])
|
||||||
|
|
||||||
pytest.raises
|
pytest.raises
|
||||||
-------------
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
**Tutorial**: :ref:`assertraises`.
|
**Tutorial**: :ref:`assertraises`.
|
||||||
|
|
||||||
|
@ -65,7 +62,7 @@ pytest.raises
|
||||||
:with: excinfo
|
:with: excinfo
|
||||||
|
|
||||||
pytest.deprecated_call
|
pytest.deprecated_call
|
||||||
----------------------
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**Tutorial**: :ref:`ensuring_function_triggers`.
|
**Tutorial**: :ref:`ensuring_function_triggers`.
|
||||||
|
|
||||||
|
@ -73,14 +70,14 @@ pytest.deprecated_call
|
||||||
:with:
|
:with:
|
||||||
|
|
||||||
pytest.register_assert_rewrite
|
pytest.register_assert_rewrite
|
||||||
------------------------------
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**Tutorial**: :ref:`assertion-rewriting`.
|
**Tutorial**: :ref:`assertion-rewriting`.
|
||||||
|
|
||||||
.. autofunction:: pytest.register_assert_rewrite
|
.. autofunction:: pytest.register_assert_rewrite
|
||||||
|
|
||||||
pytest.warns
|
pytest.warns
|
||||||
------------
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
**Tutorial**: :ref:`assertwarnings`
|
**Tutorial**: :ref:`assertwarnings`
|
||||||
|
|
||||||
|
@ -215,11 +212,10 @@ Example of a fixture requiring another fixture:
|
||||||
For more details, consult the full :ref:`fixtures docs <fixture>`.
|
For more details, consult the full :ref:`fixtures docs <fixture>`.
|
||||||
|
|
||||||
|
|
||||||
fixture decorator
|
@pytest.fixture
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. currentmodule:: _pytest.fixtures
|
.. autofunction:: pytest.fixture
|
||||||
.. autofunction:: fixture
|
|
||||||
:decorator:
|
:decorator:
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue