-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
type: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously
Description
The user-friendly error messages when test assertion fails in seems to be broken in certain situations. I have created a minimal example project to illustrate this: https://github.com/nip3o/pytest-assert-rewrite-example
When python_files setting is not set, or when the full path to the test file is specified, assertion rewrite works as expected
> pytest tests/test_addition.py
...
def test_kaka_b():
> assert 1 + 2 == 4
E assert (1 + 2) == 4
tests/test_addition.py:6: AssertionError
When adding a python_files setting to pytest.ini, and not specifying the full path to the test file, assertion rewrite does not work.
> pytest
...
def test_kaka_b():
> assert 1 + 2 == 4
E AssertionError
tests/test_addition.py:6: AssertionError
Tested in multiple projects with pytest 3.0.3 as well as 3.0.5. I have included the full output from test runs with debug mode in the repository above.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously