Skip to content

docs: explain +/- markers in failed string equality diffs#14257

Merged
nicoddemus merged 1 commit intopytest-dev:mainfrom
mitre88:patch-2
Mar 6, 2026
Merged

docs: explain +/- markers in failed string equality diffs#14257
nicoddemus merged 1 commit intopytest-dev:mainfrom
mitre88:patch-2

Conversation

@mitre88
Copy link
Contributor

@mitre88 mitre88 commented Mar 5, 2026

Summary

  • Add a short explanation for string context diff markers in assertion output.
  • Clarify that - lines come from the left-hand side of assert left == right.
  • Clarify that + lines come from the right-hand side.

Closes #3721

Notes

  • Documentation-only change; no runtime behavior changed.
  • Tests are not required for this docs clarification.

Clarify context diff output for string comparisons.
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nicoddemus nicoddemus added skip news used on prs to opt out of the changelog requirement backport 9.0.x apply to PRs at any point; backports the changes to the 9.0.x branch labels Mar 6, 2026
@nicoddemus nicoddemus merged commit 38e9af8 into pytest-dev:main Mar 6, 2026
33 checks passed
@patchback
Copy link

patchback bot commented Mar 6, 2026

Backport to 9.0.x: 💚 backport PR created

✅ Backport PR branch: patchback/backports/9.0.x/38e9af8b1a59aeab0490e71c2d9fd4c277560ceb/pr-14257

Backported as #14266

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Mar 6, 2026
Clarify context diff output for string comparisons.

(cherry picked from commit 38e9af8)
nicoddemus pushed a commit that referenced this pull request Mar 6, 2026
Clarify context diff output for string comparisons.

(cherry picked from commit 38e9af8)

Co-authored-by: Dr Alex Mitre <bedr10_capacitacion@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 9.0.x apply to PRs at any point; backports the changes to the 9.0.x branch skip news used on prs to opt out of the changelog requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please document the meaning of - and + in the output of failed string-equality assertions

2 participants