MCPcopy Index your code
hub / github.com/msgspec/msgspec / test_struct_eq_false

Method test_struct_eq_false

tests/unit/test_struct.py:1666–1677  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1664 pass
1665
1666 def test_struct_eq_false(self):
1667 class Point(Struct, eq=False):
1668 x: int
1669 y: int
1670
1671 p = Point(1, 2)
1672 # identity based equality
1673 self.assert_eq(p, p)
1674 self.assert_neq(p, Point(1, 2))
1675 # identity based hash
1676 assert hash(p) == hash(p)
1677 assert hash(p) != hash(Point(1, 2))
1678
1679 def test_struct_eq(self):
1680 class Test(Struct):

Callers

nothing calls this directly

Calls 3

assert_eqMethod · 0.95
assert_neqMethod · 0.95
PointClass · 0.70

Tested by

no test coverage detected