summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_decimal.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-03-15 04:59:17 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-03-15 04:59:17 (GMT)
commitbea3f6f5c788eb4f0f7639913ff89654152864c0 (patch)
treecf95d7cf88b4f8f77f05344b2eb7dfd80617cb0b /Lib/test/test_decimal.py
parent141f41ae1a38746578f3cecd204ec04b4006b9e1 (diff)
downloadcpython-bea3f6f5c788eb4f0f7639913ff89654152864c0.zip
cpython-bea3f6f5c788eb4f0f7639913ff89654152864c0.tar.gz
cpython-bea3f6f5c788eb4f0f7639913ff89654152864c0.tar.bz2
Bug #1163325: "special" decimals aren't hashable
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r--Lib/test/test_decimal.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index f523a72..fc1e048 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -811,6 +811,9 @@ class DecimalUsabilityTest(unittest.TestCase):
hash(Decimal(23))
#the same hash that to an int
self.assertEqual(hash(Decimal(23)), hash(23))
+ self.assertRaises(TypeError, hash, Decimal('NaN'))
+ self.assert_(hash(Decimal('Inf')))
+ self.assert_(hash(Decimal('-Inf')))
def test_min_and_max_methods(self):