Skip to content

Document assertrepr compare with assertion pass hook#14559

Open
marko1olo wants to merge 2 commits into
pytest-dev:mainfrom
marko1olo:docs-assertrepr-pass-hook-12062
Open

Document assertrepr compare with assertion pass hook#14559
marko1olo wants to merge 2 commits into
pytest-dev:mainfrom
marko1olo:docs-assertrepr-pass-hook-12062

Conversation

@marko1olo
Copy link
Copy Markdown

Fixes #12062.

Documents that pytest_assertrepr_compare may be called for passing assertions when pytest_assertion_pass is implemented, and adds a regression test for that interaction.

Validation:

  • SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST=9.0.0 uv run --reinstall-package pytest --with-editable . python -m pytest testing/test_assertrewrite.py::TestAssertionPass::test_assertrepr_compare_called_for_pass_hook -q
  • python -m compileall -q src\_pytest\hookspec.py testing\test_assertrewrite.py
  • git diff --check HEAD~1 HEAD

Not run: full pytest test suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pytest_assertrepr_compare is executed on passing assertions when a pytest_assertion_pass hook is defined

1 participant