Skip to content

Assertion rewriting does not work in packages. #68

@pytestbot

Description

@pytestbot

Originally reported by: Michał Bartoszkiewicz (BitBucket: embe, GitHub: embe)


Assertion rewriting seems inactive in modules that reside in a package.

pkg/test_foo.py, containing:

#!python
from StringIO import StringIO
def test_foo():
    s = StringIO('foo')
    assert s.read() == ''

fails with "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 --assert=plain)" when pkg/init.py exists, but with "assert 'foo' == ''" when it is deleted.


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