[Numpy-svn] r6256 - trunk/numpy/core/tests

numpy-svn@scip... numpy-svn@scip...
Mon Dec 29 23:34:25 CST 2008


Author: cdavid
Date: 2008-12-29 23:34:22 -0600 (Mon, 29 Dec 2008)
New Revision: 6256

Modified:
   trunk/numpy/core/tests/test_print.py
Log:
Special case float tests on windows: python 2.5 and below have >=3 digits in the exp.

Modified: trunk/numpy/core/tests/test_print.py
===================================================================
--- trunk/numpy/core/tests/test_print.py	2008-12-30 05:24:11 UTC (rev 6255)
+++ trunk/numpy/core/tests/test_print.py	2008-12-30 05:34:22 UTC (rev 6256)
@@ -14,7 +14,11 @@
         assert_equal(str(tp(1e10)), str(float('1e10')),
                      err_msg='Failed str formatting for type %s' % tp)
     else:
-        assert_equal(str(tp(1e10)), '1e+10',
+        if sys.platform == 'win32' and sys.version_info[0] <= 2 and sys.version_info[1] <= 5:
+            ref = '1e+010'
+        else:
+            ref = '1e+10'
+        assert_equal(str(tp(1e10)), ref,
                      err_msg='Failed str formatting for type %s' % tp)
 
 def test_float_types():
@@ -57,7 +61,11 @@
         assert_equal(str(tp(1e10)), str(complex(1e10)),
                      err_msg='Failed str formatting for type %s' % tp)
     else:
-        assert_equal(str(tp(1e10)), '(1e+10+0j)',
+        if sys.platform == 'win32' and sys.version_info[0] <= 2 and sys.version_info[1] <= 5:
+            ref = '(1e+010+0j)'
+        else:
+            ref = '(1e+10+0j)'
+        assert_equal(str(tp(1e10)), ref,
                      err_msg='Failed str formatting for type %s' % tp)
 
 def test_complex_types():



More information about the Numpy-svn mailing list