(self)
| 951 | self.assertRaises(TypeError, op, a, b) |
| 952 | |
| 953 | def test_hashing(self): |
| 954 | # Alive weakrefs hash the same as the underlying object |
| 955 | x = Object(42) |
| 956 | y = Object(42) |
| 957 | a = weakref.ref(x) |
| 958 | b = weakref.ref(y) |
| 959 | self.assertEqual(hash(a), hash(42)) |
| 960 | del x, y |
| 961 | gc.collect() |
| 962 | # Dead weakrefs: |
| 963 | # - retain their hash is they were hashed when alive; |
| 964 | # - otherwise, cannot be hashed. |
| 965 | self.assertEqual(hash(a), hash(42)) |
| 966 | self.assertRaises(TypeError, hash, b) |
| 967 | |
| 968 | @unittest.skipIf(is_wasi and Py_DEBUG, "requires deep stack") |
| 969 | def test_trashcan_16602(self): |
nothing calls this directly
no test coverage detected