8000 TST: Some fixes & refactoring around glibc-dependent skips in test_umath.py by h-vetinari · Pull Request #20274 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TST: use existence of glibc-version to clean up a test
  • Loading branch information
h-vetinari committed Nov 2, 2021
commit 56268d5cf8ded5ebe0b51cca6c23da4b0586807c
17 changes: 5 additions & 12 deletions numpy/core/tests/test_umath.py
< 52DB /tr>
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ def bad_arcsinh():
# The eps for float128 is 1-e33, so this is way bigger
return abs((v1 / v2) - 1.0) > 1e-23

if platform.machine() == 'aarch64' and bad_arcsinh():
skip_longcomplex_msg = ('Trig functions of np.longcomplex values known to be '
'inaccurate on aarch64 for some compilation '
'configurations, should be fixed by building on a '
'platform using glibc>2.17')
else:
skip_longcomplex_msg = ''


class _FilterInvalids:
def setup(self):
Expand Down Expand Up @@ -3440,13 +3432,14 @@ def check(x, rtol):
x_series = np.logspace(-20, -3.001, 200)
x_basic = np.logspace(-2.999, 0, 10, endpoint=False)

if dtype is np.longcomplex:
if glibc_older_than_2_17 and dtype is np.longcomplex:
if (platform.machine() == 'aarch64' and bad_arcsinh()):
pytest.skip("Trig functions of np.longcomplex values known "
"to be inaccurate on aarch64 for some compilation "
"configurations.")
# It's not guaranteed that the system-provided arc functions
# are accurate down to a few epsilons. (Eg. on Linux 64-bit)
# So, give more leeway for long complex tests here:
# Can use 2.1 for > Ubuntu LTS Trusty (2014), glibc = 2.19.
if skip_longcomplex_msg:
pytest.skip(skip_longcomplex_msg)
check(x_series, 50.0*eps)
else:
check(x_series, 2.1*eps)
Expand Down
0