Skip to content

Clarify pytest_assertrepr_compare in Docs #4759

@kevinjfoley

Description

@kevinjfoley

I think the documentation on the assert page for "Defining your own assertion comparison" could be clarified.

pytest/doc/en/assert.rst

Lines 208 to 212 in 7dcd9bf

Defining your own assertion comparison
----------------------------------------------
It is possible to add your own detailed explanations by implementing
the ``pytest_assertrepr_compare`` hook.

As is I interpret it as addressing how to control how two elements are compared in an assert statement. I also received an answer to a question on Stack Overflow that suggested someone else interpreted this way so I figured I'd suggest making a change.

I think changing the title to something like "Defining your own explanation for failed assertions" would make things clearer and is more in line with the docstring for pytest_assertrepr_compare.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortype: docsdocumentation improvement, missing or needing clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions