Skip to content

Commit

Permalink
typing for test_summary_stats
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Jan 29, 2020
1 parent e770330 commit 1bc591d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions testing/test_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import sys
import textwrap
from io import StringIO
from typing import Dict
from typing import List
from typing import Tuple

import pluggy
import py
Expand Down Expand Up @@ -1423,7 +1426,7 @@ def test_failure():


@pytest.fixture(scope="session")
def tr():
def tr() -> TerminalReporter:
config = _pytest.config._prepareconfig()
return TerminalReporter(config)

Expand Down Expand Up @@ -1558,14 +1561,19 @@ def tr():
),
],
)
def test_summary_stats(tr, exp_line, exp_color, stats_arg):
def test_summary_stats(
tr: TerminalReporter,
exp_line: List[Tuple[str, Dict[str, bool]]],
exp_color: str,
stats_arg: Dict[str, List],
) -> None:
tr.stats = stats_arg

# Fake "_is_last_item" to be True.
class fake_session:
testscollected = 0

tr._session = fake_session
tr._session = fake_session # type: ignore[assignment] # noqa: F821
assert tr._is_last_item

# Reset cache.
Expand Down

0 comments on commit 1bc591d

Please sign in to comment.