Skip to content

Conversation

@BahramF73
Copy link
Contributor

@BahramF73 BahramF73 commented Mar 31, 2025

Description

Fixed an issue in equality checks where bool and numpy.bool_ types were not handled consistently.
This ensures proper handling of native and numpy boolean types. See #13047.

Fix #13047

Checklist

  • Include documentation when adding new features. (Not applicable)
  • Include new tests or update existing tests when applicable.
  • Allow maintainers to push and squash when merging my commits.
  • Added closes #13047 to link this PR to the issue.
  • Created a new changelog file: 13047.bugfix.rst.
  • Added myself to AUTHORS in alphabetical order.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Mar 31, 2025
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 @BahramF73 for the PR!

Can you please add a test to ensure the code works as intended and prevent future regressions? Thanks!

@BahramF73
Copy link
Contributor Author

Hi @nicoddemus, I added some tests. Please check it!

@BahramF73 BahramF73 requested a review from nicoddemus April 1, 2025 17:57
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 @BahramF73, we appreciate it!

I will squash/merge in the next few days.

@BahramF73
Copy link
Contributor Author

Thanks @BahramF73, we appreciate it!

I will squash/merge in the next few days.

You're welcome! Glad to contribute.

@Pierre-Sassoulas Pierre-Sassoulas changed the title Fix for issue #13047 Fix broken approx when mixing numpy booleans and booleans Apr 1, 2025
@nicoddemus nicoddemus merged commit 0c45497 into pytest-dev:main Apr 2, 2025
28 checks passed
@patchback
Copy link

patchback bot commented Apr 2, 2025

Backport to 8.3.x: 💚 backport PR created

✅ Backport PR branch: patchback/backports/8.3.x/0c454979cc2038bc193eb037e80f658a9183641f/pr-13338

Backported as #13342

🤖 @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 Apr 2, 2025
Fix #13047

---------

Co-authored-by: Bruno Oliveira <[email protected]>
(cherry picked from commit 0c45497)
nicoddemus pushed a commit that referenced this pull request Apr 2, 2025
Fix #13047

---------

Co-authored-by: Bruno Oliveira <[email protected]>
(cherry picked from commit 0c45497)

Co-authored-by: Bahram Farahmand <[email protected]>
@BahramF73 BahramF73 deleted the fix-issue-13047 branch April 2, 2025 12:18
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.

8.3.4: approx broken when mixing numpy booleans and booleans

3 participants