Skip to content

Assert diff does not handle newline #1553

Closed
@Vogtinator

Description

@Vogtinator

Source:

def test_diff2():
    assert "asdf" == "asdf2"

def test_diff():
    assert "asdf" == "asdf\n"

Output:

======================================= FAILURES ========================================
______________________________________ test_diff2 _______________________________________
test_diff.py:4: in test_diff2
    assert "asdf" == "asdf2"
E   assert 'asdf' == 'asdf2'
E     - asdf
E     + asdf2
E     ?     +
_______________________________________ test_diff _______________________________________
test_diff.py:7: in test_diff
    assert "asdf" == "asdf\n"
E   assert 'asdf' == 'asdf\n'
E       asdf
=============================== 2 failed in 0.01 seconds ================================

Environment: platform linux -- Python 3.5.1, pytest-2.9.1, py-1.4.31, pluggy-0.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: reportingrelated to terminal output and user-facing messages and errorstopic: tracebacksrelated to displaying and handling of tracebackstype: 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