-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Refactor and fix assert_expected_matched_actual #65
Merged
sobolevn
merged 12 commits into
typeddjango:master
from
zero323:assert-expected-matched-actual-fix-and-refactoring
Oct 8, 2021
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ea253b8
Refactor and fix assert_expected_matched_actual
zero323 a1b4884
Reorder imports
zero323 6cb31bc
Add test file
zero323 16e92f6
Add back leading or trainling ... in case of matching input
zero323 11d6978
Fix and group leading / trailing ... logic
zero323 3ac32c3
Update test-expect-fail.yaml file
zero323 66fcd2e
Update tests
zero323 b862da8
Express error_message prefix in terms of actual and expected
zero323 69853b3
Drop data test and add unit tests
zero323 27157cb
Add return type annotation
zero323 e72e329
Make exact match on the error_message
zero323 0c1d176
Reformat utils.py
zero323 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
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 am not sure if that's the best way of showing the result in such case. Maybe something around these lines
would be better?
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.
Maybe something like this? https://github.com/wemake-services/wemake-python-styleguide/tree/master/tests/test_formatter/snapshots
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 was actually thinking about the output for this specific test, where match is followed by failure, that we didn't anticipate.
If I understand you correctly, you think about redesigning the test itself. Is that right? I glanced over linked code and
snapshottest
examples, but I am not sure if I see the advantage here. Let me sleep on that :)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.
So I took another look at this, but still don't see it (to be honest, parsing non-trivial snapshot keys hurts my brain, so I am probably biased) ‒ the arguments used here are probably to complex to be used directly, and to simple to move to files and justify the indirection (for example, not being able to just eyeball the test to understand the expectations).