Skip to content
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

[BUG] Confusing output if LF at EOL is the only difference #27

Open
webknjaz opened this issue Jul 18, 2023 · 0 comments
Open

[BUG] Confusing output if LF at EOL is the only difference #27

webknjaz opened this issue Jul 18, 2023 · 0 comments

Comments

@webknjaz
Copy link

webknjaz commented Jul 18, 2023

pytest-clarity reduces clarity of the diff if two similar strings only have \n at the end as the difference.

This is the normal pytest output (without any verbosity):

>       assert 'Not enough operands\n' == 'Not enough operands'
E       AssertionError: assert 'Not enough operands\n' == 'Not enough operands'
E         - Not enough operands
E         + Not enough operands
E         ?                    +

That + at the end means that the first string has an LF at the end and the second one does not.

This is the pytest-clarity output (with triple vebosity):

>       assert 'Not enough operands\n' == 'Not enough operands'
E       assert == failed. [pytest-clarity diff shown]
E
E         LHS vs RHS shown below
E
E         Not enough operands
E
>       assert 'Not enough operands' == 'Not enough operands\n'
E       assert == failed. [pytest-clarity diff shown]
E
E         LHS vs RHS shown below
E
E         Not enough operands
E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant