If `hash` is None, the hash generation mirrors `eq`.
(self, eq)
| 549 | |
| 550 | @given(booleans()) |
| 551 | def test_hash_attribute_mirrors_eq(self, eq): |
| 552 | """ |
| 553 | If `hash` is None, the hash generation mirrors `eq`. |
| 554 | """ |
| 555 | C = make_class("C", {"a": attr.ib(eq=eq)}, eq=True, frozen=True) |
| 556 | |
| 557 | if eq: |
| 558 | assert C(1) != C(2) |
| 559 | assert hash(C(1)) != hash(C(2)) |
| 560 | assert hash(C(1)) == hash(C(1)) |
| 561 | else: |
| 562 | assert C(1) == C(2) |
| 563 | assert hash(C(1)) == hash(C(2)) |
| 564 | |
| 565 | @given(booleans()) |
| 566 | def test_hash_mirrors_eq(self, eq): |
nothing calls this directly
no test coverage detected