Skip to content

Commit 7acfaeb

Browse files
committed
Replace item.fspath with item.path
1 parent 9e3c6b4 commit 7acfaeb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pytest_mypy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class MypyFileItem(MypyItem):
166166
def runtest(self):
167167
"""Raise an exception if mypy found errors for this item."""
168168
results = MypyResults.from_session(self.session)
169-
abspath = os.path.abspath(str(self.fspath))
169+
abspath = str(self.path.absolute())
170170
errors = results.abspath_errors.get(abspath)
171171
if errors:
172172
if not all(
@@ -179,9 +179,9 @@ def runtest(self):
179179
def reportinfo(self):
180180
"""Produce a heading for the test report."""
181181
return (
182-
self.fspath,
182+
self.path,
183183
None,
184-
str(Path(str(self.fspath)).relative_to(self.config.invocation_params.dir)),
184+
str(self.path.relative_to(self.config.invocation_params.dir)),
185185
)
186186

187187

@@ -271,7 +271,7 @@ def from_session(cls, session) -> "MypyResults":
271271
except FileNotFoundError:
272272
results = cls.from_mypy(
273273
[
274-
Path(item.fspath)
274+
item.path
275275
for item in session.items
276276
if isinstance(item, MypyFileItem)
277277
],

0 commit comments

Comments
 (0)