Skip to content

Commit 3ab09b3

Browse files
committed
fixup! WIP: last-failed: honor args
1 parent 3b7c220 commit 3ab09b3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/_pytest/cacheprovider.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,14 @@ def last_failed_paths(self):
162162
except AttributeError:
163163
rootpath = Path(self.config.rootdir)
164164
result = []
165+
abs_args = {
166+
x if Path(x).is_absolute() else rootpath / x for x in self.config.args
167+
}
165168
for nodeid in self.lastfailed:
166169
path = nodeid.split("::")[0]
167-
if not any(path.startswith(x) for x in self.config.args):
168-
continue
169170
abs_path = rootpath / path
171+
if not any(str(abs_path).startswith(x) for x in abs_args):
172+
continue
170173
if abs_path.exists():
171174
result.append(abs_path)
172175
self._last_failed_paths = result

0 commit comments

Comments
 (0)