Skip to content

Commit

Permalink
Merge pull request #241 from ndalchau/deprecated_path_pytest
Browse files Browse the repository at this point in the history
Use collection_path instead of path (deprecated) in pytest_ignore_collect
  • Loading branch information
tarpas authored Nov 5, 2024
2 parents e9765a0 + d63f044 commit 419eec1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions testmon/pytest_testmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from collections import defaultdict
from datetime import date, timedelta

from pathlib import Path
import pytest

from _pytest.config import ExitCode, Config
Expand Down Expand Up @@ -471,8 +472,8 @@ def __init__(self, config, testmon_data):
]
self._interrupted = False

def pytest_ignore_collect(self, path, config):
strpath = cached_relpath(path.strpath, config.rootdir.strpath)
def pytest_ignore_collect(self, collection_path: Path, config):
strpath = cached_relpath(str(collection_path), config.rootdir.strpath)
if strpath in self.deselected_files and self.config.testmon_config.select:
return True
return None
Expand Down

0 comments on commit 419eec1

Please sign in to comment.