-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Preserve values #56
Preserve values #56
Conversation
hi @alexmojaki, This is the upcoming feature which supports the combination of dirty-equals with inline-snapshots. You could help me with testing this branch for your use cases. |
Thanks. I just tried it and found a problem: the order of dict items is not preserved. The code gets updated to reflect the order of the actual value, whereas I'd prefer it used the order in the existing snapshot code where possible, at least for |
the order in the following example is preserved: from inline_snapshot import snapshot
def test_function():
assert {2: 3, 1: 5} == snapshot({1: 5, 2: 6})
from inline_snapshot import snapshot
def test_function():
assert {2: 3, 1: 5} == snapshot({1: 5, 2: 3}) I think I implemented the behavior which you described. Changing the order with Can you give me an example where inline-snapshot does not what you want it to do? |
OK, I think the problem is just that I should have uninstalled inline-snapshot before running |
f263f62
to
3834096
Compare
hi @alexmojaki, I'm pretty much done with the implementation (documentation still missing). I changed almost the complete implementation and you could do me a favor if you could use the last version of this branch to test it. |
e285058
to
e6d041a
Compare
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've been using this branch without problems, including in snapshots that contain non-dirty-equals variable expressions. I'm very excited for this to be released and to tell my coworkers about it!
@alexmojaki, 0.8.0 has been released. Thank you very much for your feedback. I will clarify the different flags soon when I revise some parts of the documentation. |
Fix incorrect values and preserve correct values in the same structure.
This will allow to combine inline-snapshot with libraries like dirty-equals.
Features: