MCPcopy
hub / github.com/python-attrs/attrs / test_eq_ignore_attrib

Method test_eq_ignore_attrib

tests/test_dunders.py:126–134  ·  view source on GitHub ↗

If `eq` is False for an attribute, ignore that attribute.

(self, slots)

Source from the content-addressed store, hash-verified

124
125 @given(booleans())
126 def test_eq_ignore_attrib(self, slots):
127 """
128 If `eq` is False for an attribute, ignore that attribute.
129 """
130 C = make_class(
131 "C", {"a": attr.ib(eq=False), "b": attr.ib()}, slots=slots
132 )
133
134 assert C(1, 2) == C(2, 2)
135
136 @pytest.mark.parametrize("cls", [EqC, EqCSlots])
137 def test_equal(self, cls):

Callers

nothing calls this directly

Calls 2

make_classFunction · 0.90
CClass · 0.70

Tested by

no test coverage detected