Add register_assert_rewrite and improve signature of other functions

This commit is contained in:
Bruno Oliveira 2018-03-01 17:54:54 -03:00
parent 9c2203d381
commit 8b7e6df73d
2 changed files with 18 additions and 8 deletions

View File

@ -29,7 +29,7 @@ pytest.fail
pytest.skip
~~~~~~~~~~~
.. autofunction:: _pytest.outcomes.skip
.. autofunction:: _pytest.outcomes.skip(msg, [allow_module_level=False])
pytest.importorskip
~~~~~~~~~~~~~~~~~~~
@ -42,26 +42,26 @@ pytest.xfail
.. autofunction:: _pytest.outcomes.xfail
pytest.exit
~~~~~~~~~~~
-----------
.. autofunction:: _pytest.outcomes.exit
pytest.main
~~~~~~~~~~~
-----------
.. autofunction:: _pytest.config.main
pytest.param
~~~~~~~~~~~~
------------
.. autofunction:: _pytest.mark.param
.. autofunction:: pytest.param(*values, [id], [marks])
pytest.raises
-------------
**Tutorial**: :ref:`assertraises`.
.. autofunction:: _pytest.python_api.raises
.. autofunction:: pytest.raises(expected_exception: Exception, [match], [message])
:with: excinfo
pytest.deprecated_call
@ -69,15 +69,22 @@ pytest.deprecated_call
**Tutorial**: :ref:`ensuring_function_triggers`.
.. autofunction:: _pytest.recwarn.deprecated_call
.. autofunction:: pytest.deprecated_call()
:with:
pytest.register_assert_rewrite
------------------------------
**Tutorial**: :ref:`assertion-rewriting`.
.. autofunction:: pytest.register_assert_rewrite
pytest.warns
------------
**Tutorial**: :ref:`assertwarnings`
.. autofunction:: _pytest.recwarn.warns
.. autofunction:: pytest.warns(expected_warning: Exception, [match])
:with:
Marks

View File

@ -176,6 +176,8 @@ If a package is installed this way, ``pytest`` will load
to make it easy for users to find your plugin.
.. _assertion-rewriting:
Assertion Rewriting
-------------------
@ -196,6 +198,7 @@ assertion rewriting to be enabled you need to ask ``pytest``
explicitly to rewrite this module before it gets imported.
.. autofunction:: pytest.register_assert_rewrite
:noindex:
This is especially important when you write a pytest plugin which is
created using a package. The import hook only treats ``conftest.py``