[pypy-svn] pypy default: Another apptest fix.

alex_gaynor commits-noreply at bitbucket.org
Wed Jan 19 17:26:41 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r40932:dffbdedbd0fc
Date: 2011-01-19 09:40 -0600
http://bitbucket.org/pypy/pypy/changeset/dffbdedbd0fc/

Log:	Another apptest fix.

diff --git a/pypy/objspace/std/test/test_floatobject.py b/pypy/objspace/std/test/test_floatobject.py
--- a/pypy/objspace/std/test/test_floatobject.py
+++ b/pypy/objspace/std/test/test_floatobject.py
@@ -389,22 +389,15 @@
 
 
 class AppTestFloatHex:
-
-    def setup_class(cls):
-        space = cls.space
-        cls.w_identical = space.appexec((), """():
+    def w_identical(self, x, y):
         import math
-        def identical(x, y):
-            # check that floats x and y are identical, or that both
-            # are NaNs
-            if math.isnan(x) or math.isnan(y):
-                if math.isnan(x) == math.isnan(y):
-                    return
-            assert (x == y and (x != 0.0 or
-                                math.copysign(1.0, x) == math.copysign(1.0, y)))
-        return identical
-        """)
-
+        # check that floats x and y are identical, or that both
+        # are NaNs
+        if math.isnan(x) or math.isnan(y):
+            if math.isnan(x) == math.isnan(y):
+                return
+        assert (x == y and (x != 0.0 or
+                            math.copysign(1.0, x) == math.copysign(1.0, y)))
 
     def test_from_hex(self):
         fromHex = float.fromhex


More information about the Pypy-commit mailing list