Skip to content

Commit

Permalink
Fix check_untyped_defs in test_runner
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetech committed Jan 19, 2020
1 parent 3d2680b commit 3392be3
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 75 deletions.
9 changes: 8 additions & 1 deletion src/_pytest/reports.py
@@ -1,5 +1,6 @@
from io import StringIO
from pprint import pprint
from typing import Any
from typing import List
from typing import Optional
from typing import Tuple
Expand All @@ -17,6 +18,7 @@
from _pytest._code.code import ReprLocals
from _pytest._code.code import ReprTraceback
from _pytest._code.code import TerminalRepr
from _pytest.compat import TYPE_CHECKING
from _pytest.nodes import Node
from _pytest.outcomes import skip
from _pytest.pathlib import Path
Expand All @@ -41,9 +43,14 @@ class BaseReport:
sections = [] # type: List[Tuple[str, str]]
nodeid = None # type: str

def __init__(self, **kw):
def __init__(self, **kw: Any) -> None:
self.__dict__.update(kw)

if TYPE_CHECKING:
# Can have arbitrary fields given to __init__().
def __getattr__(self, key: str) -> Any:
raise NotImplementedError()

def toterminal(self, out) -> None:
if hasattr(self, "node"):
out.line(getslaveinfoline(self.node)) # type: ignore
Expand Down

0 comments on commit 3392be3

Please sign in to comment.