Skip to content

Commit c5948c4

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

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

numpy/core/tests/test_einsum.py

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

13+
try:
14+
COMPILERS = np.show_config(mode="dicts")["Compilers"]
15+
USING_CLANG_CL = COMPILERS["c"]["name"] == "clang-cl"
16+
except TypeError:
17+
USING_CLANG_CL = False
18+
1319
# Setup for optimize einsum
1420
chars = 'abcdefghij'
1521
sizes = np.array([2, 3, 4, 5, 4, 3, 2, 6, 5, 4, 3])
@@ -611,13 +617,23 @@ def check_einsum_sums(self, dtype, do_opt=False):
611617
[2.]) # contig_stride0_outstride0_two
612618

613619
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')
620+
if (
621+
(sys.platform == 'darwin' and platform.machine() == 'x86_64')
622+
or
623+
USING_CLANG_CL
624+
):
625+
pytest.xfail('Fails on macOS x86-64 and when using clang-cl '
626+
'with Meson, see gh-23838')
616627
self.check_einsum_sums('i1')
617628

618629
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')
630+
if (
631+
(sys.platform == 'darwin' and platform.machine() == 'x86_64')
632+
or
633+
USING_CLANG_CL
634+
):
635+
pytest.xfail('Fails on macOS x86-64 and when using clang-cl '
636+
'with Meson, see gh-23838')
621637
self.check_einsum_sums('u1')
622638

623639
def test_einsum_sums_int16(self):

numpy/core/tests/test_scalarmath.py

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

20+
try:
21+
COMPILERS = np.show_config(mode="dicts")["Compilers"]
22+
USING_CLANG_CL = COMPILERS["c"]["name"] == "clang-cl"
23+
except TypeError:
24+
USING_CLANG_CL = False
25+
2026
types = [np.bool_, np.byte, np.ubyte, np.short, np.ushort, np.intc, np.uintc,
2127
np.int_, np.uint, np.longlong, np.ulonglong,
2228
np.single, np.double, np.longdouble, np.csingle,
@@ -798,7 +804,13 @@ class TestBitShifts:
798804
@pytest.mark.parametrize('op',
799805
[operator.rshift, operator.lshift], ids=['>>', '<<'])
800806
def test_shift_all_bits(self, type_code, op):
801-
""" Shifts where the shift amount is the width of the type or wider """
807+
"""Shifts where the shift amount is the width of the type or wider """
808+
if (
809+
USING_CLANG_CL and
810+
type_code in ("l", "L") and
811+
op is operator.lshift
812+
):
813+
pytest.xfail("Failing on clang-cl builds")
802814
# gh-2449
803815
dt = np.dtype(type_code)
804816
nbits = dt.itemsize * 8

0 commit comments

Comments
 (0)