Skip to content

Conversation

cmnemoi
Copy link

@cmnemoi cmnemoi commented Oct 15, 2025

Hello,

This PR fixes an issue with pytest.approx where the error message incorrectly reported all elements as mismatched when comparing mappings with different key orders, even when only some values differed.

The original code paired values by position rather than by key. This caused incorrect mismatch reporting when dictionary keys were in different orders.

This closes #12444.

Checklist

  • I have included new tests or updated existing ones where applicable.
  • I have created a new changelog file in the changelog folder, named <ISSUE NUMBER>.<TYPE>.rst.
  • I have added myself to AUTHORS in alphabetical order.
  • I have added text like “closes #XYZW” to the PR description.
  • I have allowed maintainers to push and squash when merging my commits.
  • I have included documentation when adding new features. (Not applicable here – this is a bug fix.)

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pytest approx wrong formatting return - printing all values as wrong.

1 participant