Add Monkeypatch and tutorial links for logging
This commit is contained in:
parent
adcb28f61b
commit
215c6b281e
|
@ -547,8 +547,9 @@ def raises(expected_exception, *args, **kwargs):
|
||||||
The string will be evaluated using the same ``locals()`` and ``globals()``
|
The string will be evaluated using the same ``locals()`` and ``globals()``
|
||||||
at the moment of the ``raises`` call.
|
at the moment of the ``raises`` call.
|
||||||
|
|
||||||
.. autoclass:: _pytest._code.ExceptionInfo
|
.. currentmodule:: _pytest._code
|
||||||
:members:
|
|
||||||
|
Consult the API of ``excinfo`` objects: :class:`ExceptionInfo`.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
Similar to caught exception objects in Python, explicitly clearing
|
Similar to caught exception objects in Python, explicitly clearing
|
||||||
|
|
|
@ -63,13 +63,9 @@ so that any attempts within tests to create http requests will fail.
|
||||||
help although there's no guarantee.
|
help although there's no guarantee.
|
||||||
|
|
||||||
|
|
||||||
Method reference of the monkeypatch fixture
|
.. currentmodule:: _pytest.monkeypatch
|
||||||
-------------------------------------------
|
|
||||||
|
|
||||||
.. autoclass:: MonkeyPatch
|
API Reference
|
||||||
:members:
|
-------------
|
||||||
|
|
||||||
``monkeypatch.setattr/delattr/delitem/delenv()`` all
|
|
||||||
by default raise an Exception if the target does not exist.
|
|
||||||
Pass ``raising=False`` if you want to skip this check.
|
|
||||||
|
|
||||||
|
Consult the docs for the :class:`MonkeyPatch` class.
|
||||||
|
|
|
@ -196,6 +196,9 @@ Full reference to objects accessible from :ref:`fixtures <fixture>` or hooks
|
||||||
:members:
|
:members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
.. autoclass:: _pytest._code.ExceptionInfo
|
||||||
|
:members:
|
||||||
|
|
||||||
.. autoclass:: _pytest.nodes.FSCollector()
|
.. autoclass:: _pytest.nodes.FSCollector()
|
||||||
:members:
|
:members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
@ -427,10 +430,27 @@ record_xml_property
|
||||||
caplog
|
caplog
|
||||||
~~~~~~
|
~~~~~~
|
||||||
|
|
||||||
|
**Tutorial**: :doc:`logging`.
|
||||||
|
|
||||||
.. autofunction:: _pytest.logging.caplog()
|
.. autofunction:: _pytest.logging.caplog()
|
||||||
:no-auto-options:
|
:no-auto-options:
|
||||||
|
|
||||||
This returns a :class:`_pytest.logging.LogCaptureFixture`.
|
This returns a :class:`_pytest.logging.LogCaptureFixture` instance.
|
||||||
|
|
||||||
.. autoclass:: _pytest.logging.LogCaptureFixture
|
.. autoclass:: _pytest.logging.LogCaptureFixture
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
monkeypatch
|
||||||
|
~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Tutorial**: :doc:`monkeypatch`.
|
||||||
|
|
||||||
|
.. autofunction:: _pytest.monkeypatch.monkeypatch()
|
||||||
|
:no-auto-options:
|
||||||
|
|
||||||
|
This returns a :class:`_pytest.monkeypatch.MonkeyPatch` instance.
|
||||||
|
|
||||||
|
.. autoclass:: _pytest.monkeypatch.MonkeyPatch
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue