Skip to content

Conversation

ImogenBits
Copy link
Contributor

Currently unittest.TestCase.assertLessEqual uses SupportsDunderLT and SupportsDunderGT to bound its arguments, when it should be using SupportsDunderLE and SupportsDunderGE since it's using <= in its implementation, not <. This leads to false positives when making tests for classes that only implement the lax comparisons and not the strict ones.

This PR just fixes these two bounds to use the correct protocols.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks!

@srittau srittau merged commit b76b2af into python:main Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants