diff options
| author | Gregory Lee <grlee77@gmail.com> | 2021-06-24 11:44:37 -0400 |
|---|---|---|
| committer | Gregory Lee <grlee77@gmail.com> | 2021-06-24 11:44:37 -0400 |
| commit | 8925fec4721b3a89e94d59b6149884d07fc581f4 (patch) | |
| tree | 8c4d072e0c9e0ad599283a68d121df1e973d5593 | |
| parent | 3c901b49bd8715c93824c27682d81434d869498a (diff) | |
| download | numpy-8925fec4721b3a89e94d59b6149884d07fc581f4.tar.gz | |
TST: test can_cast when only one argument has a subarray
| -rw-r--r-- | numpy/core/tests/test_casting_unittests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/tests/test_casting_unittests.py b/numpy/core/tests/test_casting_unittests.py index 2cec1acd3..34f316d5d 100644 --- a/numpy/core/tests/test_casting_unittests.py +++ b/numpy/core/tests/test_casting_unittests.py @@ -646,3 +646,9 @@ class TestCasting: with pytest.raises(TypeError, match="casting from object to the parametric DType"): cast._resolve_descriptors((np.dtype("O"), None)) + + def test_void_to_structured_with_subarray(self): + # test case corresponding to gh-19325 + dtype = np.dtype([("foo", "<f4", (3, 2))]) + assert np.can_cast("V4", dtype, casting="unsafe") + assert not np.can_cast("V4", dtype, casting="no") |
