From 61fc5ca9eeb3373d1c546fbfc47d1b2d75bbe980 Mon Sep 17 00:00:00 2001 From: Joosboy <219508079+Joosboy@users.noreply.github.com> Date: Tue, 21 Jul 2026 00:29:22 +0530 Subject: [PATCH] Docs: Document that pytest_assertrepr_compare is called on passing asserts --- src/_pytest/hookspec.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index 6c5dd4b7c4a..919ac9fa3ae 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -941,6 +941,11 @@ def pytest_assertrepr_compare( *in* a string will be escaped. Note that all but the first line will be indented slightly, the intention is for the first line to be a summary. + .. note:: + + This hook is also called for passing assertions if the + :func:`pytest_assertion_pass` hook is implemented. + :param config: The pytest config object. :param op: The operator, e.g. `"=="`, `"!="`, `"not in"`. :param left: The left operand.