@@ -140,7 +140,7 @@ def setuptestfs(self, path):
140140
141141 def test_smoke_test (self , path1 ):
142142 obj = import_module (path1 .join ("execfile.py" ))
143- assert obj .x == 42
143+ assert obj .x == 42 # type: ignore[attr-defined]
144144 assert obj .__name__ == "execfile"
145145
146146 def test_renamed_dir_creates_mismatch (self , tmpdir , monkeypatch ):
@@ -176,24 +176,24 @@ def test_dir(self, tmpdir):
176176 def test_a (self , path1 ):
177177 otherdir = path1 .join ("otherdir" )
178178 mod = import_module (otherdir .join ("a.py" ))
179- assert mod .result == "got it"
179+ assert mod .result == "got it" # type: ignore[attr-defined]
180180 assert mod .__name__ == "otherdir.a"
181181
182182 def test_b (self , path1 ):
183183 otherdir = path1 .join ("otherdir" )
184184 mod = import_module (otherdir .join ("b.py" ))
185- assert mod .stuff == "got it"
185+ assert mod .stuff == "got it" # type: ignore[attr-defined]
186186 assert mod .__name__ == "otherdir.b"
187187
188188 def test_c (self , path1 ):
189189 otherdir = path1 .join ("otherdir" )
190190 mod = import_module (otherdir .join ("c.py" ))
191- assert mod .value == "got it"
191+ assert mod .value == "got it" # type: ignore[attr-defined]
192192
193193 def test_d (self , path1 ):
194194 otherdir = path1 .join ("otherdir" )
195195 mod = import_module (otherdir .join ("d.py" ))
196- assert mod .value2 == "got it"
196+ assert mod .value2 == "got it" # type: ignore[attr-defined]
197197
198198 def test_import_after (self , tmpdir ):
199199 tmpdir .ensure ("xxxpackage" , "__init__.py" )
@@ -265,7 +265,7 @@ def foo(x): return 40 + x
265265 def test_importmode_importlib (self , simple_module ):
266266 """importlib mode does not change sys.path"""
267267 module = import_module (simple_module , mode = "importlib" )
268- assert module .foo (2 ) == 42
268+ assert module .foo (2 ) == 42 # type: ignore[attr-defined]
269269 assert simple_module .dirname not in sys .path
270270
271271 def test_importmode_twice_is_different_module (self , simple_module ):
@@ -278,7 +278,7 @@ def test_no_meta_path_found(self, simple_module, monkeypatch):
278278 """Even without any meta_path should still import module"""
279279 monkeypatch .setattr (sys , "meta_path" , [])
280280 module = import_module (simple_module , mode = "importlib" )
281- assert module .foo (2 ) == 42
281+ assert module .foo (2 ) == 42 # type: ignore[attr-defined]
282282
283283 # mode='importlib' fails if no spec is found to load the module
284284 import importlib .util
0 commit comments