Skip to content

Commit 85e756b

Browse files
committed
Use NPY_PROMOTION_STATE environment variable
1 parent 4fcf438 commit 85e756b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/tests/series/indexing/test_setitem.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
datetime,
55
)
66
from decimal import Decimal
7+
import os
78

89
import numpy as np
910
import pytest
1011

1112
from pandas._config import using_string_dtype
1213

1314
from pandas.compat import HAS_PYARROW
15+
from pandas.compat.numpy import np_version_gte1p24
1416
from pandas.errors import IndexingError
1517

1618
from pandas.core.dtypes.common import is_list_like
@@ -1443,6 +1445,13 @@ def obj(self):
14431445
np.float32,
14441446
False,
14451447
marks=pytest.mark.xfail(
1448+
(
1449+
not np_version_gte1p24
1450+
or (
1451+
np_version_gte1p24
1452+
and os.environ.get("NPY_PROMOTION_STATE", "weak") != "weak"
1453+
)
1454+
),
14461455
reason="np.float32(1.1) ends up as 1.100000023841858, so "
14471456
"np_can_hold_element raises and we cast to float64",
14481457
),

0 commit comments

Comments
 (0)