Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix broken code blocks #12449

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading