8000 TST: use existence of glibc-version to clean up a test · lithomas1/numpy@56268d5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 56268d5

Browse files
committed
TST: use existence of glibc-version to clean up a test
1 parent 01443e8 commit 56268d5

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

numpy/core/tests/test_umath.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,6 @@ def bad_arcsinh():
4848
# The eps for float128 is 1-e33, so this is way bigger
4949
return abs((v1 / v2) - 1.0) > 1e-23
5050

51-
if platform.machine() == 'aarch64' and bad_arcsinh():
52-
skip_longcomplex_msg = ('Trig functions of np.longcomplex values known to be '
53-
'inaccurate on aarch64 for some compilation '
54-
'configurations, should be fixed by building on a '
55-
'platform using glibc>2.17')
56-
else:
57-
skip_longcomplex_msg = ''
58-
5951

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

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

0 commit comments

Comments
 (0)
0