[Python-checkins] python/dist/src/Lib/test test_decimal.py, 1.16, 1.17

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Tue Mar 15 05:59:21 CET 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2896/Lib/test

Modified Files:
	test_decimal.py 
Log Message:
Bug #1163325:  "special" decimals aren't hashable



Index: test_decimal.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_decimal.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- test_decimal.py	18 Dec 2004 19:07:19 -0000	1.16
+++ test_decimal.py	15 Mar 2005 04:59:17 -0000	1.17
@@ -811,6 +811,9 @@
         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):
 



More information about the Python-checkins mailing list