[8.2.x] doc: fix broken code blocks

This commit is contained in:
Ran Benita 2024-06-11 18:36:20 +03:00 committed by pytest bot
parent eb8721d387
commit 10f688b012
4 changed files with 9 additions and 0 deletions

View File

@ -983,6 +983,7 @@ def capsys(request: SubRequest) -> Generator[CaptureFixture[str], None, None]:
Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.
Example:
.. code-block:: python
def test_output(capsys):
@ -1010,6 +1011,7 @@ def capsysbinary(request: SubRequest) -> Generator[CaptureFixture[bytes], None,
Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.
Example:
.. code-block:: python
def test_output(capsysbinary):
@ -1037,6 +1039,7 @@ def capfd(request: SubRequest) -> Generator[CaptureFixture[str], None, None]:
Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.
Example:
.. code-block:: python
def test_system_echo(capfd):
@ -1064,6 +1067,7 @@ def capfdbinary(request: SubRequest) -> Generator[CaptureFixture[bytes], None, N
Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.
Example:
.. code-block:: python
def test_system_echo(capfdbinary):

View File

@ -1737,6 +1737,7 @@ class Config:
can be used to explicitly use the global verbosity level.
Example:
.. code-block:: ini
# content of pytest.ini

View File

@ -142,6 +142,7 @@ class MonkeyPatch:
which undoes any patching done inside the ``with`` block upon exit.
Example:
.. code-block:: python
import functools

View File

@ -805,6 +805,7 @@ class Pytester:
The first created file.
Examples:
.. code-block:: python
pytester.makefile(".txt", "line1", "line2")
@ -858,6 +859,7 @@ class Pytester:
existing files.
Examples:
.. code-block:: python
def test_something(pytester):
@ -877,6 +879,7 @@ class Pytester:
existing files.
Examples:
.. code-block:: python
def test_something(pytester):