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 0783030 commit c4c780eCopy full SHA for c4c780e
src/_pytest/cacheprovider.py
@@ -161,8 +161,17 @@ def last_failed_paths(self):
161
return self._last_failed_paths
162
except AttributeError:
163
rootpath = Path(self.config.rootdir)
164
- result = {rootpath / nodeid.split("::")[0] for nodeid in self.lastfailed}
165
- result = {x for x in result if x.exists()}
+ result = []
+ abs_args = {
166
+ x if Path(x).is_absolute() else rootpath / x for x in self.config.args
167
+ }
168
+ for nodeid in self.lastfailed:
169
+ path = nodeid.split("::")[0]
170
+ abs_path = rootpath / path
171
+ if not any(str(abs_path).startswith(x) for x in abs_args):
172
+ continue
173
+ if abs_path.exists():
174
+ result.append(abs_path)
175
self._last_failed_paths = result
176
return result
177
0 commit comments