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

Assertion failures are not reported if check failures are present #44

Closed
antoche opened this issue Sep 24, 2020 · 2 comments
Closed

Assertion failures are not reported if check failures are present #44

antoche opened this issue Sep 24, 2020 · 2 comments
Labels

Comments

@antoche
Copy link

antoche commented Sep 24, 2020

Hi,

Not sure if this is similar to #43, as the description is quite succinct.

When a test contain both regular assertions and checked assertions, and both fail, only the checked assertions are reported. The regular assertion (which may very well be the root issue) is not reported, and therefore considered as passing by the user.

Example:

from pytest_check import check

def test_one():
    with check:
       assert 1 == 2
    assert 2 == 3 

Results in:

test.py F                                                                                                                                                                           [100%]

======================================================================================== FAILURES =========================================================================================
________________________________________________________________________________________ test_one _________________________________________________________________________________________
FAILURE: assert 1 == 2
test.py:5 in test_one() -> assert 1 == 2
------------------------------------------------------------
Failed Checks: 1
================================================================================ 1 failed in 0.02 seconds =================================================================================

I would have expected this output (or something similar) in addition to the existing output:

    def test_one():
        with check:
           assert 1 == 2
>       assert 2 == 3
E       assert 2 == 3

test.py:6: AssertionError

Versions tested: pytest-4.6.5 + pytest_check-0.3.6

Cheers,
A.

@okken
Copy link
Owner

okken commented Dec 14, 2020

seems bad. I'll try to look at this soon-ish

@okken
Copy link
Owner

okken commented Dec 27, 2020

Duplicate of #43

@okken okken marked this as a duplicate of #43 Dec 27, 2020
okken added a commit that referenced this issue Dec 27, 2020
okken added a commit that referenced this issue Dec 27, 2020
Fix #43/#44 tests with failing checks and failing asserts now report all issues.
@okken okken closed this as completed Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants