Skip to content

Commit

Permalink
doc: fix broken code blocks
Browse files Browse the repository at this point in the history
Caused by 4588653.

The issue was fixed in astral-sh/ruff#11577,
so won't trigger again.

Fix #12437.
  • Loading branch information
bluetech committed Jun 11, 2024
1 parent f3946dc commit cbd5a88
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/_pytest/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,7 @@ def get_verbosity(self, verbosity_type: Optional[str] = None) -> int:
can be used to explicitly use the global verbosity level.
Example:
.. code-block:: ini
# content of pytest.ini
Expand Down
1 change: 1 addition & 0 deletions src/_pytest/monkeypatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def context(cls) -> Generator["MonkeyPatch", None, None]:
which undoes any patching done inside the ``with`` block upon exit.
Example:
.. code-block:: python
import functools
Expand Down
3 changes: 3 additions & 0 deletions src/_pytest/pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,7 @@ def makefile(self, ext: str, *args: str, **kwargs: str) -> Path:
The first created file.
Examples:
.. code-block:: python
pytester.makefile(".txt", "line1", "line2")
Expand Down Expand Up @@ -858,6 +859,7 @@ def makepyfile(self, *args, **kwargs) -> Path:
existing files.
Examples:
.. code-block:: python
def test_something(pytester):
Expand All @@ -877,6 +879,7 @@ def maketxtfile(self, *args, **kwargs) -> Path:
existing files.
Examples:
.. code-block:: python
def test_something(pytester):
Expand Down

0 comments on commit cbd5a88

Please sign in to comment.