We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63c9ad0 commit 8bf343dCopy full SHA for 8bf343d
src/_pytest/cacheprovider.py
@@ -166,8 +166,17 @@ def last_failed_paths(self):
166
return self._last_failed_paths
167
except AttributeError:
168
rootpath = Path(self.config.rootdir)
169
- result = {rootpath / nodeid.split("::")[0] for nodeid in self.lastfailed}
170
- result = {x for x in result if x.exists()}
+ result = []
+ abs_args = {
171
+ x if Path(x).is_absolute() else rootpath / x for x in self.config.args
172
+ }
173
+ for nodeid in self.lastfailed:
174
+ path = nodeid.split("::")[0]
175
+ abs_path = rootpath / path
176
+ if not any(str(abs_path).startswith(x) for x in abs_args):
177
+ continue
178
+ if abs_path.exists():
179
+ result.append(abs_path)
180
self._last_failed_paths = result
181
return result
182
0 commit comments