Skip to content

Commit

Permalink
TST: core: disable C99 complex tests also on Solaris if it seems that…
Browse files Browse the repository at this point in the history
… the platform functions are flaky
  • Loading branch information
pv committed Oct 20, 2010
1 parent c6504f5 commit c0bd3df
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions numpy/core/tests/test_umath_complex.py
Expand Up @@ -10,13 +10,16 @@

# At least on Windows the results of many complex functions are not conforming
# to the C99 standard. See ticket 1574.
err = np.seterr(invalid='ignore')
# Ditto for Solaris (ticket 1642).
err = np.seterr(invalid='ignore', divide='ignore')
try:
functions_seem_flaky = (np.exp(complex(np.inf, 0)).imag != 0)
functions_seem_flaky = ((np.exp(complex(np.inf, 0)).imag != 0)
or (np.log(complex(np.NZERO, 0)).imag != np.pi))
finally:
np.seterr(**err)
# TODO: replace with a check on whether platform-provided C99 funcs are used
have_platform_functions = (sys.platform == 'win32')
have_platform_functions = (sys.platform.startswith('win')
or sys.platform.startswith('sunos'))
skip_complex_tests = have_platform_functions and functions_seem_flaky

def platform_skip(func):
Expand Down

0 comments on commit c0bd3df

Please sign in to comment.