@@ -141,7 +141,7 @@ def setuptestfs(self, path):
141
141
142
142
def test_smoke_test (self , path1 ):
143
143
obj = import_module (path1 .join ("execfile.py" ))
144
- assert obj .x == 42
144
+ assert obj .x == 42 # type: ignore[attr-defined]
145
145
assert obj .__name__ == "execfile"
146
146
147
147
def test_renamed_dir_creates_mismatch (self , tmpdir , monkeypatch ):
@@ -177,24 +177,24 @@ def test_dir(self, tmpdir):
177
177
def test_a (self , path1 ):
178
178
otherdir = path1 .join ("otherdir" )
179
179
mod = import_module (otherdir .join ("a.py" ))
180
- assert mod .result == "got it"
180
+ assert mod .result == "got it" # type: ignore[attr-defined]
181
181
assert mod .__name__ == "otherdir.a"
182
182
183
183
def test_b (self , path1 ):
184
184
otherdir = path1 .join ("otherdir" )
185
185
mod = import_module (otherdir .join ("b.py" ))
186
- assert mod .stuff == "got it"
186
+ assert mod .stuff == "got it" # type: ignore[attr-defined]
187
187
assert mod .__name__ == "otherdir.b"
188
188
189
189
def test_c (self , path1 ):
190
190
otherdir = path1 .join ("otherdir" )
191
191
mod = import_module (otherdir .join ("c.py" ))
192
- assert mod .value == "got it"
192
+ assert mod .value == "got it" # type: ignore[attr-defined]
193
193
194
194
def test_d (self , path1 ):
195
195
otherdir = path1 .join ("otherdir" )
196
196
mod = import_module (otherdir .join ("d.py" ))
197
- assert mod .value2 == "got it"
197
+ assert mod .value2 == "got it" # type: ignore[attr-defined]
198
198
199
199
def test_import_after (self , tmpdir ):
200
200
tmpdir .ensure ("xxxpackage" , "__init__.py" )
@@ -266,7 +266,7 @@ def foo(x): return 40 + x
266
266
def test_importmode_importlib (self , simple_module ):
267
267
"""importlib mode does not change sys.path"""
268
268
module = import_module (simple_module , mode = "importlib" )
269
- assert module .foo (2 ) == 42
269
+ assert module .foo (2 ) == 42 # type: ignore[attr-defined]
270
270
assert simple_module .dirname not in sys .path
271
271
272
272
def test_importmode_twice_is_different_module (self , simple_module ):
@@ -279,7 +279,7 @@ def test_no_meta_path_found(self, simple_module, monkeypatch):
279
279
"""Even without any meta_path should still import module"""
280
280
monkeypatch .setattr (sys , "meta_path" , [])
281
281
module = import_module (simple_module , mode = "importlib" )
282
- assert module .foo (2 ) == 42
282
+ assert module .foo (2 ) == 42 # type: ignore[attr-defined]
283
283
284
284
# mode='importlib' fails if no spec is found to load the module
285
285
import importlib .util
0 commit comments