10000 assert reinterpretation fails for some code layouts · Issue #1 · pytest-dev/pytest · GitHub
[go: up one dir, main page]

Skip to content
assert reinterpretation fails for some code layouts #1
@pytestbot

Description

@pytestbot

Originally reported by: Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt)


the code example is

#!python

def test_assert():
    result = None
    assert result == [
        (None, [ 'some text\n', 'more text\n']),
    ]

the given output is

$ py.test test_assert.py 
============================= test session starts ==============================
platform linux2 -- Python 2.6.6 -- pytest-2.0.0dev0
test path 1: test_assert.py

test_assert.py F

=================================== FAILURES ===================================
_________________________________ test_assert __________________________________

    def test_assert():
        result = None
        assert result == [
>           (None, [ 'some text\n', 'more text\n']),
E           AssertionError: (assertion failed, but when it was re-run for printing intermediate values, it did not fail.  Suggestions: compute assert expression before the assert or use --no-assert)

test_assert.py:5: AssertionError
=========================== 1 failed in 0.20 seconds ===========================

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: 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

      0