Skip to content

Commit b30e7bd

Browse files
authored
Merge pull request #6045 from blueyed/minor
minor: typing for ReprFailDoctest
2 parents db9e248 + 1371b01 commit b30e7bd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/_pytest/doctest.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import traceback
77
import warnings
88
from contextlib import contextmanager
9+
from typing import Sequence
10+
from typing import Tuple
911

1012
import pytest
1113
from _pytest import outcomes
@@ -119,11 +121,12 @@ def _is_doctest(config, path, parent):
119121

120122

121123
class ReprFailDoctest(TerminalRepr):
122-
def __init__(self, reprlocation_lines):
123-
# List of (reprlocation, lines) tuples
124+
def __init__(
125+
self, reprlocation_lines: Sequence[Tuple[ReprFileLocation, Sequence[str]]]
126+
):
124127
self.reprlocation_lines = reprlocation_lines
125128

126-
def toterminal(self, tw):
129+
def toterminal(self, tw) -> None:
127130
for reprlocation, lines in self.reprlocation_lines:
128131
for line in lines:
129132
tw.line(line)

0 commit comments

Comments
 (0)