Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verbose output no longer shows diff #10770

Closed
4 tasks done
elliotwutingfeng opened this issue Feb 26, 2023 · 2 comments
Closed
4 tasks done

Verbose output no longer shows diff #10770

elliotwutingfeng opened this issue Feb 26, 2023 · 2 comments
Labels
topic: rewrite related to the assertion rewrite mechanism type: regression indicates a problem that was introduced in a release which was working previously

Comments

@elliotwutingfeng
Copy link

elliotwutingfeng commented Feb 26, 2023

  • a detailed description of the bug or problem you are having
  • output of pip list from the virtual environment you are using
  • pytest and operating system versions
  • minimal example if possible

When running python -m pytest -v for this function on pytest=7.1.0

def test_add():
    assert 2 + 2 == 22, "This should fail"

I get

========================================================================================= FAILURES ==========================================================================================
_________________________________________________________________________________________ test_add __________________________________________________________________________________________

    def test_add():
>       assert 2 + 2 == 22, "This should fail"
E       AssertionError: This should fail
E       assert (2 + 2) == 22

tests/test_chapter5.py:2: AssertionError

when I should be getting this instead

========================================================================================= FAILURES ==========================================================================================
_________________________________________________________________________________________ test_add __________________________________________________________________________________________

    def test_add():
>       assert 2 + 2 == 22, "This should fail"
E       AssertionError: This should fail
E       assert 4 == 22
E         +4
E         -22

tests/test_chapter5.py:2: AssertionError
  • I get the correct output on pytest=7.0.1.
  • Still getting the wrong output as of pytest=7.2.2 (current version at time of this writing).
  • The output behaviour changed from fac8f28 onwards, not sure if this is working as intended.
  • Using -vv instead of -v produces the same result.

System

Python 3.10.9. Linux x64 Kernel 6.1.12-1-MANJARO

pip list output

Package        Version
-------------- -------
attrs          22.2.0
exceptiongroup 1.1.0
iniconfig      2.0.0
more-itertools 9.1.0
packaging      23.0
pip            23.0.1
pluggy         0.13.1
py             1.11.0
pytest         7.2.2
setuptools     67.5.1
toml           0.10.2
tomli          2.0.1
@Zac-HD Zac-HD added type: regression indicates a problem that was introduced in a release which was working previously topic: rewrite related to the assertion rewrite mechanism labels Mar 5, 2023
@itsJustAbe
Copy link

i am able to reproduce the same behaviour in the latest version, can someone please confirm if that is expected behaviour ?

@nicoddemus
Copy link
Member

Hi,

Thanks for posting the versions, that helped track down the issue.

It was an intentional change introduced in #9661, as we deemed the diff output was not useful.

@elliotwutingfeng elliotwutingfeng closed this as not planned Won't fix, can't repro, duplicate, stale Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: rewrite related to the assertion rewrite mechanism type: regression indicates a problem that was introduced in a release which was working previously
Projects
None yet
Development

No branches or pull requests

4 participants