@@ -86,6 +86,7 @@ def _case_fail(msg: str) -> NoReturn:
86
86
# optionally followed by lines of text.
87
87
item = first_item = test_items [0 ]
88
88
test_modules .append ("__main__" )
89
+ ignore = "\n # mypy: allow-untyped-defs, allow-any-explicit\n "
89
90
for item in test_items [1 :]:
90
91
91
92
def _item_fail (msg : str ) -> NoReturn :
@@ -110,13 +111,13 @@ def _item_fail(msg: str) -> NoReturn:
110
111
assert item .arg is not None
111
112
mpath = join (os .path .dirname (case .file ), item .arg )
112
113
with open (mpath , encoding = "utf8" ) as f :
113
- files .append ((join (base_path , "builtins.pyi" ), f .read ()))
114
+ files .append ((join (base_path , "builtins.pyi" ), f .read () + ignore ))
114
115
elif item .id == "typing" :
115
116
# Use an alternative stub file for the typing module.
116
117
assert item .arg is not None
117
118
src_path = join (os .path .dirname (case .file ), item .arg )
118
119
with open (src_path , encoding = "utf8" ) as f :
119
- files .append ((join (base_path , "typing.pyi" ), f .read ()))
120
+ files .append ((join (base_path , "typing.pyi" ), f .read () + ignore ))
120
121
elif item .id == "_typeshed" :
121
122
# Use an alternative stub file for the _typeshed module.
122
123
assert item .arg is not None
0 commit comments