diff options
author | Daniel Hahler <git@thequod.de> | 2019-10-23 03:28:47 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-10-23 10:52:42 +0200 |
commit | 1371b01f78afcfb836ef21a81cdb9b6516c1119e (patch) | |
tree | a7c29cf29be49232399c34a9bb9fa8aa0a48d492 /src/_pytest/doctest.py | |
parent | f0c2b070c5be690ab2285f44cae51b521cf53e52 (diff) | |
download | pytest-1371b01f78afcfb836ef21a81cdb9b6516c1119e.tar.gz |
typing for ReprFailDoctest
Diffstat (limited to 'src/_pytest/doctest.py')
-rw-r--r-- | src/_pytest/doctest.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index 1bd2642ae..fd65a3cc7 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -6,6 +6,8 @@ import sys import traceback import warnings from contextlib import contextmanager +from typing import Sequence +from typing import Tuple import pytest from _pytest import outcomes @@ -113,11 +115,12 @@ def _is_doctest(config, path, parent): class ReprFailDoctest(TerminalRepr): - def __init__(self, reprlocation_lines): - # List of (reprlocation, lines) tuples + def __init__( + self, reprlocation_lines: Sequence[Tuple[ReprFileLocation, Sequence[str]]] + ): self.reprlocation_lines = reprlocation_lines - def toterminal(self, tw): + def toterminal(self, tw) -> None: for reprlocation, lines in self.reprlocation_lines: for line in lines: tw.line(line) |