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

No pretty failure message for in statements #240

Closed
JoshKarpel opened this issue May 29, 2021 · 2 comments · Fixed by #242
Closed

No pretty failure message for in statements #240

JoshKarpel opened this issue May 29, 2021 · 2 comments · Fixed by #242
Labels
enhancement New feature or request

Comments

@JoshKarpel
Copy link
Contributor

Working on tests for #233 and noticed that in statements don't seem to be getting rewritten to produce pretty output. Minimal example:

@test("assert in not working?")
def _():
    assert "foo" in "bar"
─────────────────────────────────────────────── assert in not working? ───────────────────────────────────────────────

  Failed at tests/test_terminal.py:300

      298 @test("assert in not working?")
      299 def _():
    ❱ 300     assert "foo" in "bar"
      301

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@darrenburns
Copy link
Owner

We only print pretty output for the == operator:

if err.operator == Comparison.Equals:

If we wanted to print special output for the in case, we could add it to the above block of code.

It's not as clear what we'd print in that case, since a diff won't make sense for anything other than equality checks.

@JoshKarpel
Copy link
Contributor Author

Ah, gotcha... I will see if I can come up with anything nice :)

@JoshKarpel JoshKarpel changed the title Assertion rewriting not triggering for in statements No pretty failure message for in statements May 29, 2021
@darrenburns darrenburns added the enhancement New feature or request label May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants