summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-01-18 23:36:14 (GMT)
committerGuido van Rossum <guido@python.org>2001-01-18 23:36:14 (GMT)
commit0c6614c78904b6ad0a92033a3224b95d182f1b17 (patch)
tree96ad50d6ec96380a59650c8cd26aa409c2110dac /Lib
parent41c3244875dbe2a549ff1f41f8fdca66992a6994 (diff)
downloadcpython-0c6614c78904b6ad0a92033a3224b95d182f1b17.zip
cpython-0c6614c78904b6ad0a92033a3224b95d182f1b17.tar.gz
cpython-0c6614c78904b6ad0a92033a3224b95d182f1b17.tar.bz2
Add test that ensures hash([]) and hash({}) raise TypeError.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_b1.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_b1.py b/Lib/test/test_b1.py
index 9511079..ea09d0b 100644
--- a/Lib/test/test_b1.py
+++ b/Lib/test/test_b1.py
@@ -267,6 +267,12 @@ if not hash(1) == hash(1L) == hash(1.0): raise TestFailed, 'numeric hash()'
hash('spam')
hash((0,1,2,3))
def f(): pass
+try: hash([])
+except TypeError: pass
+else: raise TestFailed, "hash([]) should raise an exception"
+try: hash({})
+except TypeError: pass
+else: raise TestFailed, "hash({}) should raise an exception"
print 'hex'
if hex(16) != '0x10': raise TestFailed, 'hex(16)'