[pypy-svn] r68518 - pypy/branch/gc-hash/pypy/objspace/std/test

arigo at codespeak.net arigo at codespeak.net
Thu Oct 15 22:31:19 CEST 2009


Author: arigo
Date: Thu Oct 15 22:31:18 2009
New Revision: 68518

Modified:
   pypy/branch/gc-hash/pypy/objspace/std/test/test_floatobject.py
Log:
hash(nan) is not well-defined on CPython.  Be vague in the test too.


Modified: pypy/branch/gc-hash/pypy/objspace/std/test/test_floatobject.py
==============================================================================
--- pypy/branch/gc-hash/pypy/objspace/std/test/test_floatobject.py	(original)
+++ pypy/branch/gc-hash/pypy/objspace/std/test/test_floatobject.py	Thu Oct 15 22:31:18 2009
@@ -59,7 +59,10 @@
         inf = 1e200 * 1e200
         assert hash(inf) == 314159
         assert hash(-inf) == -271828
-        assert hash(inf/inf) == 0
+        x = hash(inf/inf)
+        # ^^^ assert did not crash, even though the result is a bit random
+        #     e.g. it appears to be -32768 on Win32 and 0 on Linux
+        assert x == hash(inf/inf)
 
     def test_int_float(self):
         assert int(42.1234) == 42



More information about the Pypy-commit mailing list