MCPcopy Create free account
hub / github.com/msgspec/msgspec / test_struct_eq_identity_fastpath

Method test_struct_eq_identity_fastpath

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

Source from the content-addressed store, hash-verified

1712 self.assert_neq(x, z)
1713
1714 def test_struct_eq_identity_fastpath(self):
1715 class Bad:
1716 def __eq__(self, other):
1717 raise ValueError("Oh no!")
1718
1719 class Test(Struct):
1720 a: int
1721 b: Bad
1722
1723 t = Test(1, Bad())
1724 self.assert_eq(t, t)
1725
1726 @pytest.mark.parametrize("op", ["le", "lt", "ge", "gt"])
1727 def test_struct_order(self, op):

Callers

nothing calls this directly

Calls 3

assert_eqMethod · 0.95
TestClass · 0.70
BadClass · 0.70

Tested by

no test coverage detected