Classes are not hashable by default.
(self)
| 603 | assert hash(a) != hash(b) |
| 604 | |
| 605 | def test_hash_default(self): |
| 606 | """ |
| 607 | Classes are not hashable by default. |
| 608 | """ |
| 609 | C = make_class("C", {}) |
| 610 | |
| 611 | with pytest.raises(TypeError) as e: |
| 612 | hash(C()) |
| 613 | |
| 614 | assert e.value.args[0] in ( |
| 615 | "'C' objects are unhashable", # PyPy |
| 616 | "unhashable type: 'C'", # CPython |
| 617 | ) |
| 618 | |
| 619 | def test_cache_hashing(self): |
| 620 | """ |
nothing calls this directly
no test coverage detected