Skip to content

Commit 23ca979

Browse files
authored
doc: fix broken code blocks (#12449)
Caused by 4588653. The issue was fixed in astral-sh/ruff#11577, so won't trigger again. Fix #12437.
1 parent f3946dc commit 23ca979

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

src/_pytest/capture.py

+4
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,7 @@ def capsys(request: SubRequest) -> Generator[CaptureFixture[str], None, None]:
983983
Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.
984984
985985
Example:
986+
986987
.. code-block:: python
987988
988989
def test_output(capsys):
@@ -1010,6 +1011,7 @@ def capsysbinary(request: SubRequest) -> Generator[CaptureFixture[bytes], None,
10101011
Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.
10111012
10121013
Example:
1014+
10131015
.. code-block:: python
10141016
10151017
def test_output(capsysbinary):
@@ -1037,6 +1039,7 @@ def capfd(request: SubRequest) -> Generator[CaptureFixture[str], None, None]:
10371039
Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.
10381040
10391041
Example:
1042+
10401043
.. code-block:: python
10411044
10421045
def test_system_echo(capfd):
@@ -1064,6 +1067,7 @@ def capfdbinary(request: SubRequest) -> Generator[CaptureFixture[bytes], None, N
10641067
Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.
10651068
10661069
Example:
1070+
10671071
.. code-block:: python
10681072
10691073
def test_system_echo(capfdbinary):

src/_pytest/config/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1735,6 +1735,7 @@ def get_verbosity(self, verbosity_type: Optional[str] = None) -> int:
17351735
can be used to explicitly use the global verbosity level.
17361736
17371737
Example:
1738+
17381739
.. code-block:: ini
17391740
17401741
# content of pytest.ini

src/_pytest/monkeypatch.py

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def context(cls) -> Generator["MonkeyPatch", None, None]:
142142
which undoes any patching done inside the ``with`` block upon exit.
143143
144144
Example:
145+
145146
.. code-block:: python
146147
147148
import functools

src/_pytest/pytester.py

+3
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ def makefile(self, ext: str, *args: str, **kwargs: str) -> Path:
805805
The first created file.
806806
807807
Examples:
808+
808809
.. code-block:: python
809810
810811
pytester.makefile(".txt", "line1", "line2")
@@ -858,6 +859,7 @@ def makepyfile(self, *args, **kwargs) -> Path:
858859
existing files.
859860
860861
Examples:
862+
861863
.. code-block:: python
862864
863865
def test_something(pytester):
@@ -877,6 +879,7 @@ def maketxtfile(self, *args, **kwargs) -> Path:
877879
existing files.
878880
879881
Examples:
882+
880883
.. code-block:: python
881884
882885
def test_something(pytester):

0 commit comments

Comments
 (0)