summaryrefslogtreecommitdiff
path: root/numpy/ma/tests/test_regression.py
diff options
context:
space:
mode:
authorTyler Reddy <tyler.je.reddy@gmail.com>2023-03-03 13:06:38 -0700
committerTyler Reddy <tyler.je.reddy@gmail.com>2023-03-03 16:16:08 -0700
commit9fe3554b33ed1c3e7c8c78a8ac97322c0a16f7cb (patch)
tree1b2bf8930efc71bcb791c4cfaf04c237f56b860b /numpy/ma/tests/test_regression.py
parent74a127974a66b6a70667cc6d6d3597880bc81d2b (diff)
downloadnumpy-9fe3554b33ed1c3e7c8c78a8ac97322c0a16f7cb.tar.gz
BUG: ma with structured dtype
Fixes #22041 * add regression test and fix for creating a masked array with a structured dtype; the test is simply for lack of error in the repoducer * the concern expressed by core team in matching issue was that `astropy` might be negatively affected; I ran full `astropy` (hash: `c9ad7c56`) test suite locally with this feature branch and it seemed "ok," just 1 unrelated network failure in the network-requiring tests (`test_ftp_tls_auto`): ```1 failed, 21430 passed, 3490 skipped, 176 xfailed, 23275 warnings in 430.18s (0:07:10)```
Diffstat (limited to 'numpy/ma/tests/test_regression.py')
-rw-r--r--numpy/ma/tests/test_regression.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_regression.py b/numpy/ma/tests/test_regression.py
index cb3d0349f..f4f32cc7a 100644
--- a/numpy/ma/tests/test_regression.py
+++ b/numpy/ma/tests/test_regression.py
@@ -89,3 +89,9 @@ class TestRegression:
def test_masked_array_tobytes_fortran(self):
ma = np.ma.arange(4).reshape((2,2))
assert_array_equal(ma.tobytes(order='F'), ma.T.tobytes())
+
+ def test_structured_array(self):
+ # see gh-22041
+ np.ma.array((1, (b"", b"")),
+ dtype=[("x", np.int_),
+ ("y", [("i", np.void), ("j", np.void)])])