File tree 2 files changed +103
-75
lines changed
2 files changed +103
-75
lines changed Original file line number Diff line number Diff line change 1
1
from io import StringIO
2
2
from pprint import pprint
3
+ from typing import Any
3
4
from typing import List
4
5
from typing import Optional
5
6
from typing import Tuple
17
18
from _pytest ._code .code import ReprLocals
18
19
from _pytest ._code .code import ReprTraceback
19
20
from _pytest ._code .code import TerminalRepr
21
+ from _pytest .compat import TYPE_CHECKING
20
22
from _pytest .nodes import Node
21
23
from _pytest .outcomes import skip
22
24
from _pytest .pathlib import Path
@@ -41,9 +43,14 @@ class BaseReport:
41
43
sections = [] # type: List[Tuple[str, str]]
42
44
nodeid = None # type: str
43
45
44
- def __init__ (self , ** kw ) :
46
+ def __init__ (self , ** kw : Any ) -> None :
45
47
self .__dict__ .update (kw )
46
48
49
+ if TYPE_CHECKING :
50
+ # Can have arbitrary fields given to __init__().
51
+ def __getattr__ (self , key : str ) -> Any :
52
+ raise NotImplementedError ()
53
+
47
54
def toterminal (self , out ) -> None :
48
55
if hasattr (self , "node" ):
49
56
out .line (getslaveinfoline (self .node )) # type: ignore
You can’t perform that action at this time.
0 commit comments