-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
--tb=no should remove tracebacks from xml output #80
Comments
This is a very good point. Are you interested in working on a fix? |
I am happy to contribute on this. pytest has many options for --tb (https://docs.pytest.org/en/7.0.x/how-to/output.html#modifying-python-traceback-printing). Is it necessary to support all of them in pytest-check or just some of them? |
I was just trying to reproduce the problem and don't see a problem. test_foo.py from pytest_check import check
def test_multiple_failures():
a = (1, 2, 3)
b = (3, 2, 1)
with check:
assert a == b
with check:
assert b == a Normal multiple failures: $ pytest test_foo.py
========================= test session starts ==========================
collected 1 item
test_foo.py F [100%]
=============================== FAILURES ===============================
________________________ test_multiple_failures ________________________
FAILURE: assert (1, 2, 3) == (3, 2, 1)
At index 0 diff: 1 != 3
Use -v to get more diff
test_foo.py:6 in test_multiple_failures() -> with check:
FAILURE: assert (3, 2, 1) == (1, 2, 3)
At index 0 diff: 3 != 1
Use -v to get more diff
test_foo.py:8 in test_multiple_failures() -> with check:
------------------------------------------------------------
Failed Checks: 2
======================= short test summary info ========================
FAILED test_foo.py::test_multiple_failures
========================== 1 failed in 0.02s =========================== With $ pytest --tb=no test_foo.py
========================= test session starts ==========================
collected 1 item
test_foo.py F [100%]
======================= short test summary info ========================
FAILED test_foo.py::test_multiple_failures
========================== 1 failed in 0.02s =========================== Isn't this what you were asking for? |
With When use
xml content
When just use assert, with
xml content
|
Ah. Ok. |
PR created. #81 |
Thank you. I’ll take a look later this week. |
Changing title from "Cannot disable the traceback in the error message" |
fixed by version 1.0.10 |
In Pytest you can disable the traceback by --tb=no
https://docs.pytest.org/en/7.0.x/how-to/output.html#modifying-python-traceback-printing
But in pytest_check, we cannot do that. If there are multiple failures in one test, it will be hard to look at the error message with lots of traceback
The text was updated successfully, but these errors were encountered: