From 02b0f1951332140dedf8c2cceedc6af3ae74059f Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Tue, 30 Dec 2008 05:34:22 +0000 Subject: Special case float tests on windows: python 2.5 and below have >=3 digits in the exp. --- numpy/core/tests/test_print.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'numpy') diff --git a/numpy/core/tests/test_print.py b/numpy/core/tests/test_print.py index fe78ddf0c..c6ce27bc3 100644 --- a/numpy/core/tests/test_print.py +++ b/numpy/core/tests/test_print.py @@ -14,7 +14,11 @@ def check_float_type(tp): 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 @@ def check_complex_type(tp): 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(): -- cgit v1.2.1