summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2020-06-25 14:39:02 -0500
committerSebastian Berg <sebastian@sipsolutions.net>2020-07-08 18:13:06 -0500
commitb36750b11c2be22e42b6dbb61c60242b0a0c9eeb (patch)
tree3b4adcea5dec253cc9bdffbe22037a4aeea1109b
parentd39953c060a8c3da785062413234f02a7d8f5b95 (diff)
downloadnumpy-b36750b11c2be22e42b6dbb61c60242b0a0c9eeb.tar.gz
TST: datetime64 test_scalar_coercion does not fail anymore
The rational test still fails, but the xfail message was wrong or confusing.
-rw-r--r--numpy/core/tests/test_array_coercion.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/numpy/core/tests/test_array_coercion.py b/numpy/core/tests/test_array_coercion.py
index 333f357a9..ee8350947 100644
--- a/numpy/core/tests/test_array_coercion.py
+++ b/numpy/core/tests/test_array_coercion.py
@@ -248,11 +248,10 @@ class TestScalarDiscovery:
# Ensure we have a full-precision number if available
scalar = type(scalar)((scalar * 2)**0.5)
- if is_parametric_dtype(scalar.dtype) or type(scalar) is rational:
- # datetime with unit will be named "datetime64[unit]"
+ if type(scalar) is rational:
# Rational generally fails due to a missing cast. In the future
# object casts should automatically be defined based on `setitem`.
- pytest.xfail("0-D object array to a unit-less datetime cast fails")
+ pytest.xfail("Rational to object cast is undefined currently.")
# Use casting from object:
arr = np.array(scalar, dtype=object).astype(scalar.dtype)