typing for ReprFailDoctest
This commit is contained in:
parent
f0c2b070c5
commit
1371b01f78
|
@ -6,6 +6,8 @@ import sys
|
||||||
import traceback
|
import traceback
|
||||||
import warnings
|
import warnings
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
from typing import Sequence
|
||||||
|
from typing import Tuple
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from _pytest import outcomes
|
from _pytest import outcomes
|
||||||
|
@ -113,11 +115,12 @@ def _is_doctest(config, path, parent):
|
||||||
|
|
||||||
|
|
||||||
class ReprFailDoctest(TerminalRepr):
|
class ReprFailDoctest(TerminalRepr):
|
||||||
def __init__(self, reprlocation_lines):
|
def __init__(
|
||||||
# List of (reprlocation, lines) tuples
|
self, reprlocation_lines: Sequence[Tuple[ReprFileLocation, Sequence[str]]]
|
||||||
|
):
|
||||||
self.reprlocation_lines = reprlocation_lines
|
self.reprlocation_lines = reprlocation_lines
|
||||||
|
|
||||||
def toterminal(self, tw):
|
def toterminal(self, tw) -> None:
|
||||||
for reprlocation, lines in self.reprlocation_lines:
|
for reprlocation, lines in self.reprlocation_lines:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
tw.line(line)
|
tw.line(line)
|
||||||
|
|
Loading…
Reference in New Issue