summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorSebastian Berg <sebastianb@nvidia.com>2022-11-08 15:14:29 +0100
committerSebastian Berg <sebastianb@nvidia.com>2022-11-08 15:27:12 +0100
commit518313ba108a86ac803a723e81ed858a53c368ae (patch)
tree25b9b3ac046003de24c2bb713c492726d81d9afd /numpy/core
parenta09cc4311cd39b80dd0aa9f17d75e65a06595547 (diff)
downloadnumpy-518313ba108a86ac803a723e81ed858a53c368ae.tar.gz
ENH: Ensure we will transition to an error for `np.r_[int8_arr, 300]`
That is, once the NEP 50 transition happens
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/tests/test_nep50_promotions.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/core/tests/test_nep50_promotions.py b/numpy/core/tests/test_nep50_promotions.py
index 5d4917c94..12202db57 100644
--- a/numpy/core/tests/test_nep50_promotions.py
+++ b/numpy/core/tests/test_nep50_promotions.py
@@ -178,3 +178,11 @@ def test_nep50_integer_regression():
arr = np.array(1)
assert (arr + 2**63).dtype == np.float64
assert (arr[()] + 2**63).dtype == np.float64
+
+def test_nep50_with_axisconcatenator():
+ # I promised that this will be an error in the future in the 1.24
+ # release notes; test this (NEP 50 opt-in makes the deprecation an error).
+ np._set_promotion_state("weak")
+
+ with pytest.raises(OverflowError):
+ np.r_[np.arange(5, dtype=np.int8), 255]