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

only 1 traceback displayed #120

Open
dpinol opened this issue Jan 19, 2023 · 1 comment
Open

only 1 traceback displayed #120

dpinol opened this issue Jan 19, 2023 · 1 comment

Comments

@dpinol
Copy link

dpinol commented Jan 19, 2023

According to README.md, this

def test_example():
    a = 1
    b = 2
    c = [2, 4, 6]
    check.greater(a, b)
    check.less_equal(b, a)
    check.is_in(a, c, "Is 1 in the list")
    check.is_not_in(b, c, "make sure 2 isn't in list")

should display

=================================== FAILURES ===================================
_________________________________ test_example _________________________________
FAILURE:
assert 1 > 2
  test_check.py, line 14, in test_example() -> check.greater(a, b)
FAILURE:
assert 2 <= 1
  test_check.py, line 15, in test_example() -> check.less_equal(b, a)
FAILURE: Is 1 in the list
assert 1 in [2, 4, 6]
  test_check.py, line 16, in test_example() -> check.is_in(a, c, "Is 1 in the list")
FAILURE: make sure 2 isn't in list
assert 2 not in [2, 4, 6]
  test_check.py, line 17, in test_example() -> check.is_not_in(b, c, "make sure 2 isn't in list")
------------------------------------------------------------
Failed Checks: 4
=========================== 1 failed in 0.11 seconds ===========================

On my machine, it just displays 1 traceback:

platform linux -- Python 3.11.0, pytest-7.2.1, pluggy-1.0.0
rootdir: sc-microscope, configfile: pyproject.toml
plugins: check-2.1.2
collected 1 item                                                                                                                                                           

test/gui/test_persist.py::test_example FAILED                                                                                                                        [100%]

================================================================================= FAILURES =================================================================================
_______________________________________________________________________________ test_example _______________________________________________________________________________
FAILURE: check 1 > 2
test/gui/test_persist.py:110 in test_example() -> check.greater(a, b)

FAILURE: check 2 <= 1
FAILURE: check 1 in [2, 4, 6]: Is 1 in the list
FAILURE: check 2 not in [2, 4, 6]: make sure 2 isn't in list
------------------------------------------------------------
Failed Checks: 4
========================================================================= short test summary info ==========================================================================
FAILED test/gui/test_persist.py::test_example
============================================================================ 1 failed in 0.02s =============================================================================

@okken
Copy link
Owner

okken commented Jan 23, 2023

You're right. We do need to update the documentation. Thanks.
The flag --check-max-tb was added recently to control the number of tracebacks.
If you set --check-max-tb=5 or larger, you'll see all of those tracebacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants