@@ -181,13 +181,13 @@ def pytest_make_collect_report(self, collector) -> Generator:
181
181
# Sort any lf-paths to the beginning.
182
182
lf_paths = self .lfplugin ._last_failed_paths
183
183
res .result = sorted (
184
- res .result , key = lambda x : 0 if Path (x .fspath ) in lf_paths else 1 ,
184
+ res .result , key = lambda x : 0 if Path (str ( x .fspath ) ) in lf_paths else 1 ,
185
185
)
186
186
out .force_result (res )
187
187
return
188
188
189
189
elif isinstance (collector , Module ):
190
- if Path (collector .fspath ) in self .lfplugin ._last_failed_paths :
190
+ if Path (str ( collector .fspath ) ) in self .lfplugin ._last_failed_paths :
191
191
out = yield
192
192
res = out .get_result ()
193
193
@@ -214,7 +214,7 @@ def __init__(self, lfplugin: "LFPlugin"):
214
214
@pytest .hookimpl
215
215
def pytest_make_collect_report (self , collector ) -> Optional [CollectReport ]:
216
216
if isinstance (collector , Module ):
217
- if Path (collector .fspath ) not in self .lfplugin ._last_failed_paths :
217
+ if Path (str ( collector .fspath ) ) not in self .lfplugin ._last_failed_paths :
218
218
self .lfplugin ._skipped_files += 1
219
219
220
220
return CollectReport (
@@ -246,7 +246,7 @@ def __init__(self, config: Config) -> None:
246
246
247
247
def get_last_failed_paths (self ) -> Set [Path ]:
248
248
"""Returns a set with all Paths()s of the previously failed nodeids."""
249
- rootpath = Path (self .config .rootdir )
249
+ rootpath = Path (str ( self .config .rootdir ) )
250
250
result = {rootpath / nodeid .split ("::" )[0 ] for nodeid in self .lastfailed }
251
251
return {x for x in result if x .exists ()}
252
252
0 commit comments