Skip to content

fix: ensure syrupy's pytest_assertrepr_compare hook is called first.#984

Merged
noahnu merged 1 commit intosyrupy-project:mainfrom
rahuliyer95:fix/assert-hook
Jun 4, 2025
Merged

fix: ensure syrupy's pytest_assertrepr_compare hook is called first.#984
noahnu merged 1 commit intosyrupy-project:mainfrom
rahuliyer95:fix/assert-hook

Conversation

@rahuliyer95
Copy link
Contributor

@rahuliyer95 rahuliyer95 commented Jun 4, 2025

Description

When using syrupy with pytest-clarity the pytest_assertrepr_compare is called from pytest-clarity. This PR ensure syrupy's pytest_assertrepr_compare is called first which gives it the ability to handle SnapshotAssertion before any other plugin. The code already does an early exit if the left or right value(s) are not SnapshotAssertion and automatically falling back to any other plugin that implements pytest_assertrepr_compare.

Related Issues

N/A

Checklist

  • This PR has sufficient documentation.
  • This PR has sufficient test coverage.
  • This PR title satisfies semantic convention.

Additional Comments

No additional comments.

@codecov
Copy link

codecov bot commented Jun 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #984   +/-   ##
=======================================
  Coverage   97.32%   97.33%           
=======================================
  Files          21       21           
  Lines        1685     1686    +1     
=======================================
+ Hits         1640     1641    +1     
  Misses         45       45           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@noahnu noahnu merged commit eb0024d into syrupy-project:main Jun 4, 2025
13 of 15 checks passed
@noahnu
Copy link
Collaborator

noahnu commented Jun 4, 2025

@all-contributors add @rahuliyer95 for bug

@allcontributors
Copy link
Contributor

@noahnu

I've put up a pull request to add @rahuliyer95! 🎉

@noahnu noahnu added this to the syrupy/5.0.0 milestone Jun 4, 2025
@rahuliyer95 rahuliyer95 deleted the fix/assert-hook branch June 4, 2025 21:26
@noahnu
Copy link
Collaborator

noahnu commented Sep 28, 2025

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants