Skip to content

Commit

Permalink
Add an identity check to flexible_equal
Browse files Browse the repository at this point in the history
  • Loading branch information
pschanely committed Dec 13, 2024
1 parent dad570d commit f84c5f5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crosshair/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def check_messages(checkables: Iterable[Checkable], **kw) -> ComparableLists:


def flexible_equal(a, b):
if a is b:
return True
if type(a) is type(b) and type(a).__eq__ is object.__eq__:
# If types match and it uses identity-equals, we can't do much. Assume equal.
return True
Expand Down

0 comments on commit f84c5f5

Please sign in to comment.