[Numpy-svn] r8623 - trunk/numpy/core/tests
numpy-svn at scipy.org
numpy-svn at scipy.org
Sat Aug 14 09:42:59 EDT 2010
Author: rgommers
Date: 2010-08-14 08:42:59 -0500 (Sat, 14 Aug 2010)
New Revision: 8623
Modified:
trunk/numpy/core/tests/test_umath_complex.py
Log:
TST: skip C99 nan/inf tests on Windows.
Modified: trunk/numpy/core/tests/test_umath_complex.py
===================================================================
--- trunk/numpy/core/tests/test_umath_complex.py 2010-08-14 13:42:38 UTC (rev 8622)
+++ trunk/numpy/core/tests/test_umath_complex.py 2010-08-14 13:42:59 UTC (rev 8623)
@@ -1,3 +1,5 @@
+import sys
+
from numpy.testing import *
import numpy.core.umath as ncu
import numpy as np
@@ -6,6 +8,20 @@
# TODO: conj 'symmetry'
# TODO: FPU exceptions
+# At least on Windows the results of many complex functions are not conforming
+# to the C99 standard. See ticket 1574.
+functions_seem_flaky = (np.exp(complex(np.inf, 0)).imag != 0)
+# TODO: replace with a check on whether platform-provided C99 funcs are used
+have_platform_functions = (sys.platform == 'win32')
+skip_complex_tests = have_platform_functions and functions_seem_flaky
+
+def platform_skip(func):
+ return dec.skipif(skip_complex_tests,
+ "Numpy is using complex functions (e.g. sqrt) provided by your"
+ "platform's C library. However, they do not seem to behave according"
+ "to C99 -- so C99 tests are skipped.")(func)
+
+
class TestCexp(object):
def test_simple(self):
check = check_complex_value
@@ -17,6 +33,7 @@
ref = np.exp(1) * np.complex(np.cos(1), np.sin(1))
yield check, f, 1, 1, ref.real, ref.imag, False
+ @platform_skip
def test_special_values(self):
# C99: Section G 6.3.1
@@ -127,6 +144,7 @@
for i in range(len(x)):
assert_almost_equal(y[i], y_r[i])
+ @platform_skip
def test_special_values(self):
xl = []
yl = []
@@ -297,6 +315,7 @@
#def test_branch_cut(self):
# _check_branch_cut(f, -1, 0, 1, -1)
+ @platform_skip
def test_special_values(self):
check = check_complex_value
f = np.sqrt
More information about the Numpy-svn
mailing list