Skip to content

Incorrectly dropping brackets on display of assertions #925

@DRMacIver

Description

@DRMacIver

If I have the following test:

def test_ternary_display():
    assert (False == False) == False

then this will correctly fail, but will display as:

    def test_ternary_display():
>       assert (False == False) == False
E       assert False == False == False

display.py:2: AssertionError

This is wrong. The brackets are required because "False == False == False" evaluates to True. In Python this is the same as "(False == False) and (False == False)" due to the rules about chaining operators.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: reportingrelated to terminal output and user-facing messages and errorstype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions