Skip to content

Commit

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

Fix #12437.
  • Loading branch information
bluetech committed Jun 11, 2024
1 parent f3946dc commit 3990ef3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ lint.ignore = [
"D401", # First line of docstring should be in imperative mood
"D402", # First line should not be the function's signature
"D404", # First word of the docstring should not be "This"
"D412", # No blank lines allowed between a section header and its content
"D415", # First line should end with a period, question mark, or exclamation point
# pytest can do weird low-level things, and we usually know
# what we're doing when we use type(..) is ...
Expand Down
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 3990ef3

Please sign in to comment.