Skip to content

Commit

Permalink
Merge pull request #193 from michael-k/fix-192
Browse files Browse the repository at this point in the history
Use `pathlib.Path` in plugin hooks
  • Loading branch information
carsongee authored Apr 13, 2024
2 parents 65e3d97 + 62457e8 commit 2fc6263
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pytest_pylint/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,16 @@ def pytest_sessionfinish(self, session):
if hasattr(session.config, "cache"):
session.config.cache.set(HISTKEY, self.mtimes)

def pytest_collect_file(self, path, parent):
def pytest_collect_file(self, file_path, parent):
"""Collect files on which pylint should run"""
if path.ext != ".py":
if file_path.suffix != ".py":
return None

rel_path = get_rel_path(path.strpath, str(parent.session.path))
rel_path = file_path.relative_to(parent.session.path)
if should_include_file(
rel_path, self.pylint_ignore, self.pylint_ignore_patterns
str(rel_path), self.pylint_ignore, self.pylint_ignore_patterns
):
item = PylintFile.from_parent(parent, path=Path(path), plugin=self)
item = PylintFile.from_parent(parent, path=file_path, plugin=self)
else:
return None

Expand Down

0 comments on commit 2fc6263

Please sign in to comment.