-
Notifications
You must be signed in to change notification settings - Fork 103
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
snapshot stored value will be changed after assert_match
#99
Comments
assert_match
assert_match
Would welcome a PR to fix this! Not sure whether that will be easy or not. |
This looks like it will be non-trivial to fix. The problem is that during updating, SnapshotTest.assert_match just stores a simple reference to the value it's passed. The value isn't actually serialized into a snapshot until later (after all tests in a particular module). So if anything modifies that value in between, the snapshot will be written with the wrong value. Couple of options:
|
Thanks for looking into this.
Agree that this would be the way to go. |
BREAKING CHANGE: values have to be copyable with `copy.deepcopy` This is a behaviour which is already expected from other libraries. syrusakbary/snapshottest#99
BREAKING CHANGE: values have to be copyable with `copy.deepcopy` This is a behaviour which is already expected from other libraries. syrusakbary/snapshottest#99
BREAKING CHANGE: values have to be copyable with `copy.deepcopy` This is a behaviour which is already expected from other libraries. syrusakbary/snapshottest#99
e.g.
test case
snapshot
The text was updated successfully, but these errors were encountered: