Skip to content

Commit b3b981e

Browse files
pre-commit-ci[bot]nicoddemus
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent aeda81b commit b3b981e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/en/how-to/types.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ For more information, refer to `Python's Typing Documentation <https://docs.pyth
99
Why type tests?
1010
---------------
1111

12-
Typing tests provides significant advantages:
12+
Typing tests provides significant advantages:
1313

1414
- **Readability:** Clearly defines expected inputs and outputs, improving readability, especially in complex or parameterized tests.
1515

@@ -23,8 +23,8 @@ For production code, typing also helps catching some bugs that might not be caug
2323
for value, caption in items:
2424
if value == target:
2525
return caption
26-
27-
26+
27+
2828
The type checker will correctly error out that the function might return `None`, however even a full coverage test suite might miss that case:
2929

3030
.. code-block:: python
@@ -50,7 +50,7 @@ To type fixtures in pytest, just add normal types to the fixture functions -- th
5050
@pytest.fixture
5151
def sample_fixture() -> int:
5252
return 38
53-
53+
5454
In the same manner, the fixtures passed to test functions need be annotated with the fixture's return type:
5555

5656
.. code-block:: python
@@ -67,6 +67,7 @@ The same logic applies to `@pytest.mark.parametrize`:
6767
6868
import pytest
6969
70+
7071
@pytest.mark.parametrize("input_value, expected_output", [(1, 2), (5, 6), (10, 11)])
7172
def test_increment(input_value: int, expected_output: int) -> None:
7273
assert input_value + 1 == expected_output

0 commit comments

Comments
 (0)