-
Notifications
You must be signed in to change notification settings - Fork 40
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
Ensure that untouched snapshots are not deleted in targeting mode #123
Conversation
Codecov Report
@@ Coverage Diff @@
## master #123 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 705 715 +10
=========================================
+ Hits 705 715 +10 |
CHANGELOG.md
Outdated
@@ -10,6 +10,10 @@ From v1.0.0 onwards, this project adheres to [Semantic Versioning](https://semve | |||
|
|||
- Up to date with releases. | |||
|
|||
## [v0.3.2](https://github.com/tophat/syrupy/compare/v.0.3.1...v0.3.2) |
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.
@noahnu Is this the correct way to go about writing out the changelog manually?
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 looks great! 🎉
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.
Amazing!
@all-contributors please add @mcataford for code, test |
I've put up a pull request to add @mcataford! 🎉 |
|
||
target_snaps = {snap.location for snap in self.used} | ||
|
||
return item.location in target_snaps |
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.
I think item.location in self.used
would have just worked here without needing to create target_snaps
Description
This PR adds some handling around filenames that can be passed to
pytest
to target testfiles. Previously, passing in file paths would run the tests on these paths, and consider snapshots that weren't touched as unused -- even though they were actually used by other tests not targeted bypytest
in that instance.By passing down a list of targeted files and using a filtering function, this takes out snapshots that aren't related to the targeted files, if
pytest
is passed some paths. This way,syrupy
no longer purges snapshots by mistake.Related Issues
This addresses #119.
Checklist