If `hash` is None, the hash generation mirrors `eq`.
(self, eq)
| 564 | |
| 565 | @given(booleans()) |
| 566 | def test_hash_mirrors_eq(self, eq): |
| 567 | """ |
| 568 | If `hash` is None, the hash generation mirrors `eq`. |
| 569 | """ |
| 570 | C = make_class("C", {"a": attr.ib()}, eq=eq, frozen=True) |
| 571 | |
| 572 | i = C(1) |
| 573 | |
| 574 | assert i == i |
| 575 | assert hash(i) == hash(i) |
| 576 | |
| 577 | if eq: |
| 578 | assert C(1) == C(1) |
| 579 | assert hash(C(1)) == hash(C(1)) |
| 580 | else: |
| 581 | assert C(1) != C(1) |
| 582 | assert hash(C(1)) != hash(C(1)) |
| 583 | |
| 584 | @pytest.mark.parametrize( |
| 585 | "cls", |
nothing calls this directly
no test coverage detected