From b463a7fcee642eb75ec7fd5faa33f3fabbcfb258 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Wed, 1 Jun 2022 08:23:08 -0700 Subject: TST: Improve test coverage for complex FPE cast errors --- numpy/core/tests/test_casting_floatingpoint_errors.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'numpy') 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"]: -- cgit v1.2.1