[Python-checkins]
python/dist/src/Lib/test test_decimal.py, 1.15.2.1, 1.15.2.2
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Wed Mar 16 00:36:22 CET 2005
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32366/lib/test
Modified Files:
Tag: release24-maint
test_decimal.py
Log Message:
Decimal special values did not hash properly.
Index: test_decimal.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_decimal.py,v
retrieving revision 1.15.2.1
retrieving revision 1.15.2.2
diff -u -d -r1.15.2.1 -r1.15.2.2
--- test_decimal.py 18 Dec 2004 19:12:11 -0000 1.15.2.1
+++ test_decimal.py 15 Mar 2005 23:36:19 -0000 1.15.2.2
@@ -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