8000 TST: Xfail tests when using clang-cl · numpy/numpy@fe5fdcf · GitHub
[go: up one dir, main page]

Skip to content

Commit fe5fdcf

Browse files
committed
TST: Xfail tests when using clang-cl
1 parent aa0cf30 commit fe5fdcf

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

numpy/core/tests/test_einsum.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
assert_raises, suppress_warnings, assert_raises_regex, assert_allclose
1111
)
1212

13+
COMPILERS =np.show_config(mode="dicts")["Compilers"]
14+
USING_CLANG_CL = COMPILERS["c"]["name"] == "clang-cl"
15+
1316
# Setup for optimize einsum
1417
chars = 'abcdefghij'
1518
sizes = np.array([2, 3, 4, 5, 4, 3, 2, 6, 5, 4, 3])
@@ -611,13 +614,23 @@ def check_einsum_sums(self, dtype, do_opt=False):
611614
[2.]) # contig_stride0_outstride0_two
612615

613616
def test_einsum_sums_int8(self):
614-
if sys.platform == 'darwin' and platform.machine() == 'x86_64':
615-
pytest.xfail('Fails on macOS x86-64 with Meson, see gh-23838')
617+
if (
618+
(sys.platform == 'darwin' and platform.machine() == 'x86_64')
619+
or
620+
USING_CLANG_CL
621+
):
622+
pytest.xfail('Fails on macOS x86-64 and when using clang-cl '
623+
'with Meson, see gh-23838')
616624
self.check_einsum_sums('i1')
617625

618626
def test_einsum_sums_uint8(self):
619-
if sys.platform == 'darwin' and platform.machine() == 'x86_64':
620-
pytest.xfail('Fails on macOS x86-64 with Meson, see gh-23838')
627+
if (
628+
(sys.platform == 'darwin' and platform.machine() == 'x86_64')
629+
or
630+
USING_CLANG_CL
631+
):
632+
pytest.xfail('Fails on macOS x86-64 and when using clang-cl '
633+
'with Meson, see gh-23838')
621634
self.check_einsum_sums('u1')
622635

623636
def test_einsum_sums_int16(self):

numpy/core/tests/test_scalarmath.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
assert_warns, _SUPPORTS_SVE,
1818
)
1919

20+
COMPILERS =np.show_config(mode="dicts")["Compilers"]
21+
USING_CLANG_CL = COMPILERS["c"]["name"] == "clang-cl"
22+
2023
types = [np.bool_, np.byte, np.ubyte, np.short, np.ushort, np.intc, np.uintc,
2124
np.int_, np.uint, np.longlong, np.ulonglong,
2225
np.single, np.double, np.longdouble, np.csingle,
@@ -798,7 +801,13 @@ class TestBitShifts:
798801
@pytest.mark.parametrize('op',
799802
[operator.rshift, operator.lshift], ids=['>>', '<<'])
800803
def test_shift_all_bits(self, type_code, op):
801-
""" Shifts where the shift amount is the width of the type or wider """
804+
"""Shifts where the shift amount is the width of the type or wider """
805+
if (
806+
USING_CLANG_CL and
807+
type_code in ("l", "L") and
808+
op is operator.lshift
809+
):
810+
pytest.xfail("Failing on clang-cl builds")
802811
# gh-2449
803812
dt = np.dtype(type_code)
804813
nbits = dt.itemsize * 8

0 commit comments

Comments
 (0)
0