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.
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
fix: unused snapshot detection for targeting single parameterized test case #394
fix: unused snapshot detection for targeting single parameterized test case #394
Changes from 11 commits
c8bcf8c
5f1b55d
20ebcfc
4c28d9f
242df48
1c97282
0a91953
a40aba9
950de5c
33c8372
a0ae1c9
51dd223
ac39bcb
61d8748
43282f2
f67f281
baf8dab
7435bea
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative to importing the protected class is to roll our own parsing of
-k
expressions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just confirming this works in the min. version of pytest we support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't will test that out, probably should have a way to automate the CI range test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah no this does not work with pytest 5...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to include a naive version of the
Expression
class for compatibility with older pytest versions while still giving us some of the scaffolding for keyword snapshot inclusionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignoring the marker expression as they can not be used to match against snapshot names and are already used to select which pytest items in the collection to run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the
and not self.is_providing_nodes
check to the point of usage atif self.ran_all_collected_tests and not any(provided_nodes):
, makes the method name more accurate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main gist of the fix. Basically
_selected_items_match_name
use the keyword expressions when they are present or matches against the ran items when no keywords provided or_provided_nodes_match_name
checks if the nodes given for the test file matching this fossil location matches the snapshot name.