summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-06-01 08:23:08 -0700
committerSebastian Berg <sebastian@sipsolutions.net>2022-06-13 09:36:57 -0700
commitb463a7fcee642eb75ec7fd5faa33f3fabbcfb258 (patch)
tree44e651380d82be5fb00a752e52a48500e9533cad /numpy
parent8d2d9a58cc824c6bad6b17e552fbd79f19403756 (diff)
downloadnumpy-b463a7fcee642eb75ec7fd5faa33f3fabbcfb258.tar.gz
TST: Improve test coverage for complex FPE cast errors
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_casting_floatingpoint_errors.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/tests/test_casting_floatingpoint_errors.py b/numpy/core/tests/test_casting_floatingpoint_errors.py
index ea348e658..7248e7a08 100644
--- a/numpy/core/tests/test_casting_floatingpoint_errors.py
+++ b/numpy/core/tests/test_casting_floatingpoint_errors.py
@@ -34,6 +34,12 @@ def values_and_dtypes():
yield param(np.finfo(np.longdouble).max, "float64",
id="longdouble-to-f8")
+ # Cast to complex32:
+ yield param(2e300, "complex64", id="float-to-c8")
+ yield param(2e300+0j, "complex64", id="complex-to-c8")
+ yield param(2e300j, "complex64", id="complex-to-c8")
+ yield param(np.longdouble(2e300), "complex64", id="longdouble-to-c8")
+
# Invalid float to integer casts:
with np.errstate(over="ignore"):
for to_dt in np.typecodes["AllInteger"]: