Skip to content

Commit 163866c

Browse files
committed
Add return type annotations for mypy
1 parent d3bd04a commit 163866c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

testing/test_argparsing_repr_fix.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
"""
22
Test case for issue #13817: AttributeError with invalid flag in pytest_addoption
33
"""
4-
54
from __future__ import annotations
65

6+
import pytest
7+
78
from _pytest.config.argparsing import ArgumentError
89
from _pytest.config.argparsing import Parser
9-
import pytest
1010

1111

1212
# Suppress warning about using private pytest API (we're testing pytest itself)
1313
@pytest.mark.filterwarnings("ignore::pytest.PytestDeprecationWarning")
1414
class TestArgumentReprFix:
1515
"""Test that Argument.__repr__ handles missing dest attribute."""
1616

17-
def test_invalid_option_without_dashes(self):
17+
def test_invalid_option_without_dashes(self) -> None:
1818
"""Test that invalid option names produce helpful error messages."""
1919
parser = Parser()
2020

@@ -30,7 +30,7 @@ def test_invalid_option_without_dashes(self):
3030
assert "AttributeError" not in error_message
3131
assert "has no attribute 'dest'" not in error_message
3232

33-
def test_invalid_short_option(self):
33+
def test_invalid_short_option(self) -> None:
3434
"""Test that invalid short option names produce helpful error messages."""
3535
parser = Parser()
3636

@@ -44,11 +44,11 @@ def test_invalid_short_option(self):
4444
or "invalid short option string" in error_message
4545
)
4646

47-
def test_valid_option_works(self):
47+
def test_valid_option_works(self) -> None:
4848
"""Test that valid options still work correctly."""
4949
parser = Parser()
5050
parser.addoption("--shuffle", action="store_true", help="Shuffle tests")
5151

5252
options = parser._anonymous.options
5353
assert len(options) > 0
54-
assert "--shuffle" in options[0].names()
54+
assert "--shuffle" in options[0].names()

0 commit comments

Comments
 (0)