Skip to content

Commit c943991

Browse files
committed
Fix linting (mypy errors)
1 parent e9f9190 commit c943991

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

testing/test_pathlib.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def setuptestfs(self, path):
141141

142142
def test_smoke_test(self, path1):
143143
obj = import_module(path1.join("execfile.py"))
144-
assert obj.x == 42
144+
assert obj.x == 42 # type: ignore[attr-defined]
145145
assert obj.__name__ == "execfile"
146146

147147
def test_renamed_dir_creates_mismatch(self, tmpdir, monkeypatch):
@@ -177,24 +177,24 @@ def test_dir(self, tmpdir):
177177
def test_a(self, path1):
178178
otherdir = path1.join("otherdir")
179179
mod = import_module(otherdir.join("a.py"))
180-
assert mod.result == "got it"
180+
assert mod.result == "got it" # type: ignore[attr-defined]
181181
assert mod.__name__ == "otherdir.a"
182182

183183
def test_b(self, path1):
184184
otherdir = path1.join("otherdir")
185185
mod = import_module(otherdir.join("b.py"))
186-
assert mod.stuff == "got it"
186+
assert mod.stuff == "got it" # type: ignore[attr-defined]
187187
assert mod.__name__ == "otherdir.b"
188188

189189
def test_c(self, path1):
190190
otherdir = path1.join("otherdir")
191191
mod = import_module(otherdir.join("c.py"))
192-
assert mod.value == "got it"
192+
assert mod.value == "got it" # type: ignore[attr-defined]
193193

194194
def test_d(self, path1):
195195
otherdir = path1.join("otherdir")
196196
mod = import_module(otherdir.join("d.py"))
197-
assert mod.value2 == "got it"
197+
assert mod.value2 == "got it" # type: ignore[attr-defined]
198198

199199
def test_import_after(self, tmpdir):
200200
tmpdir.ensure("xxxpackage", "__init__.py")
@@ -266,7 +266,7 @@ def foo(x): return 40 + x
266266
def test_importmode_importlib(self, simple_module):
267267
"""importlib mode does not change sys.path"""
268268
module = import_module(simple_module, mode="importlib")
269-
assert module.foo(2) == 42
269+
assert module.foo(2) == 42 # type: ignore[attr-defined]
270270
assert simple_module.dirname not in sys.path
271271

272272
def test_importmode_twice_is_different_module(self, simple_module):
@@ -279,7 +279,7 @@ def test_no_meta_path_found(self, simple_module, monkeypatch):
279279
"""Even without any meta_path should still import module"""
280280
monkeypatch.setattr(sys, "meta_path", [])
281281
module = import_module(simple_module, mode="importlib")
282-
assert module.foo(2) == 42
282+
assert module.foo(2) == 42 # type: ignore[attr-defined]
283283

284284
# mode='importlib' fails if no spec is found to load the module
285285
import importlib.util

0 commit comments

Comments
 (0)