summaryrefslogtreecommitdiff
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 3c607f70cc..53b7611fb0 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -3283,12 +3283,20 @@ order (MRO) for bases """
self.assertEqual(hash(d), 144)
D.__hash__ = lambda self: 100
self.assertEqual(hash(d), 100)
+ D.__hash__ = None
+ self.assertRaises(TypeError, hash, d)
del D.__hash__
self.assertEqual(hash(d), 144)
+ B.__hash__ = None
+ self.assertRaises(TypeError, hash, d)
del B.__hash__
self.assertEqual(hash(d), 314)
+ C.__hash__ = None
+ self.assertRaises(TypeError, hash, d)
del C.__hash__
self.assertEqual(hash(d), 42)
+ A.__hash__ = None
+ self.assertRaises(TypeError, hash, d)
del A.__hash__
self.assertEqual(hash(d), orig_hash)
d.foo = 42