Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify failure deduplication in looponfail #544

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/xdist/looponfail.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,7 @@ def loop_once(self):
if collection_failed:
pass # "Collection failed, keeping previous failure set"
else:
uniq_failures = []
for failure in failures:
if failure not in uniq_failures:
uniq_failures.append(failure)
self.failures = uniq_failures
self.failures = list(set(failures))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this preserve order?

Copy link
Contributor Author

@lgeiger lgeiger Mar 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not, I can change it to

Suggested change
self.failures = list(set(failures))
self.failures = list(dict.fromkeys(failures))

which will preserve the order if required.



def repr_pytest_looponfailinfo(failreports, rootdirs):
Expand Down