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