-
-
Notifications
You must be signed in to change notification settings - Fork 26
-
-
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
Improve line matching behavior #77
Comments
I am happy to give it a shot, if there is interest in such feature. |
Awesome! Let's try it. However, the end result might be even more confusing, so let's just keep an open mind 🙂 |
Sure, I am not getting particularly attached to code :) And even if it brings desired results, it might be still something that should be configurable, in case someone already depends on the current behavior. |
This is a feature request.
Summary:
Currently rows are matched by their position in the file / output.
User experience could be improved, if matching was performed by
(file, line-number)
.Details:
Let's assume that I have a test case like this
When I run tests I see:
If you analyze the test case, you'll see that actual state is like this:
however alignment message
clearly shows that we start with comparing line 2 of expected and line 1 of actual.
This escalates to all the following lines and probably gets worse with multi-line messages (I wanted to investigate that, hence #66).
I am aware that this is consistent with behavior of the internal mypy test suite, which returns
for equivalent input, but it seems a bit counter-intuitive. While it detects presence of output mismatch, it cannot do much beyond that.
Ideally, I'd like to see something around these lines:
(no alignment needed for an empty line).
This should generalize to multiple interleaved blocks of matching and not matching lines, where matching blocks are indicated, but omitted.
Furthermore, errors shouldn't propagate beyond current line, in case of multline output.
Originally posted by @zero323 in #65 (comment)
The text was updated successfully, but these errors were encountered: