Simplify failure deduplication in looponfail#544
Open
lgeiger wants to merge 1 commit intopytest-dev:masterfrom
Open
Simplify failure deduplication in looponfail#544lgeiger wants to merge 1 commit intopytest-dev:masterfrom
lgeiger wants to merge 1 commit intopytest-dev:masterfrom
Conversation
RonnyPfannschmidt
requested changes
Feb 7, 2021
Member
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
i finally got to this
it looks good, it took a bit to follow back how it goes into the remotes trails variable
please rebase to master and add a changelog entry (or let me know if i may do that for you)
nice find!
e8f7d61 to
f51cd65
Compare
Contributor
Author
|
Sorry for the late reply, I somehow missed the review. I rebased onto master, let's see what CI thinks. |
| if failure not in uniq_failures: | ||
| uniq_failures.append(failure) | ||
| self.failures = uniq_failures | ||
| self.failures = list(set(failures)) |
Member
There was a problem hiding this comment.
does this preserve order?
Contributor
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR simplifies deduplication of failures in
looponfailusingsetinstead of iterating over all failures. This should simplify the code and in general might be a bit faster as well.