Skip to content

Commit 1e3bc18

Browse files
committed
typing for test_summary_stats
1 parent 57512aa commit 1e3bc18

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

testing/test_terminal.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
import sys
88
import textwrap
99
from io import StringIO
10+
from typing import Dict
11+
from typing import List
12+
from typing import Tuple
1013

1114
import pluggy
1215
import py
@@ -1345,7 +1348,7 @@ def test_failure():
13451348

13461349

13471350
@pytest.fixture(scope="session")
1348-
def tr():
1351+
def tr() -> TerminalReporter:
13491352
config = _pytest.config._prepareconfig()
13501353
return TerminalReporter(config)
13511354

@@ -1480,14 +1483,19 @@ def tr():
14801483
),
14811484
],
14821485
)
1483-
def test_summary_stats(tr, exp_line, exp_color, stats_arg):
1486+
def test_summary_stats(
1487+
tr: TerminalReporter,
1488+
exp_line: List[Tuple[str, Dict[str, bool]]],
1489+
exp_color: str,
1490+
stats_arg: Dict[str, List],
1491+
) -> None:
14841492
tr.stats = stats_arg
14851493

14861494
# Fake "_is_last_item" to be True.
14871495
class fake_session:
14881496
testscollected = 0
14891497

1490-
tr._session = fake_session
1498+
tr._session = fake_session # type: ignore[assignment] # noqa: F821
14911499
assert tr._is_last_item
14921500

14931501
# Reset cache.

0 commit comments

Comments
 (0)