pytest
pytest copied to clipboard
`pytest_assertrepr_compare` is executed on passing assertions when a `pytest_assertion_pass` hook is defined
-
[X] a detailed description of the bug or problem you are having the documentation for
pytest_assertrepr_comparestates that this hook is only called when an assertion fails. however if apytest_assertion_passhook is present, then thepytest_assertrepr_comparehook also gets called when the assertion passes.not sure if it's intentional or not, but if it is, this behavior should be mentioned in the docs
-
[ ] output of
pip listfrom the virtual environment you are using not using pip -
[X] pytest and operating system versions pytest 8.1.0, windows 10 & 11
-
[X] minimal example if possible
# conftest.py def pytest_assertrepr_compare(): raise Exception # this gets called even though the assertion passed def pytest_assertion_pass(): pass# test_foo.py def test_foo(): assert 0 == 0