Skip to content

missing evaluated value in report when asserting a boolean attribute (using --assert=rewrite) #1503

Closed
@bagerard

Description

@bagerard

Hi there,

First of all, thank you for the amazing work you've done on pytest! It is really cool!
When asserting a boolean attribute of an object, the actual value isn't printed in the output as it would be with other types (int, str, etc). I'm using latest pytest 2.9.1

def test_a():
    class AA():
        pass
    a = AA()
    a.t = False
    assert a.t is True

Provides the following output (using with ---assert=rewrite):

...

  assert a.t is True

E assert <test.AA instance at 0x7fb9399169e0>.t is True

And if run with ---assert=reinterp:

...

  assert a.t is True

E assert False is True
E + where False = <test.AA instance at 0x7f24de4740e0>.t

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: help wanteddevelopers would like help from experts on this topictopic: reportingrelated to terminal output and user-facing messages and errorstype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions