diff options
author | Matti Picus <matti.picus@gmail.com> | 2019-09-16 09:36:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-16 09:36:39 +0300 |
commit | 5e74e9d5996419dd10c30e5d397f2a0dcf2ca0a9 (patch) | |
tree | 12f628a546449f8d9171dad90c395eeb6609ee29 /numpy/lib/tests/test_recfunctions.py | |
parent | f8694923d0a4b241369726bfda8bbea29099a848 (diff) | |
parent | 003bdc25b75566de64a90e223338b4bd4565155a (diff) | |
download | numpy-5e74e9d5996419dd10c30e5d397f2a0dcf2ca0a9.tar.gz |
Merge pull request #14511 from eric-wieser/fix-flatten_dtype
BUG: Fix flatten_dtype so that nested 0-field structs are flattened correctly
Diffstat (limited to 'numpy/lib/tests/test_recfunctions.py')
-rw-r--r-- | numpy/lib/tests/test_recfunctions.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/lib/tests/test_recfunctions.py b/numpy/lib/tests/test_recfunctions.py index f9355c2e1..fa5f4dec2 100644 --- a/numpy/lib/tests/test_recfunctions.py +++ b/numpy/lib/tests/test_recfunctions.py @@ -380,8 +380,8 @@ class TestMergeArrays(object): z = np.array( [('A', 1.), ('B', 2.)], dtype=[('A', '|S3'), ('B', float)]) w = np.array( - [(1, (2, 3.0)), (4, (5, 6.0))], - dtype=[('a', int), ('b', [('ba', float), ('bb', int)])]) + [(1, (2, 3.0, ())), (4, (5, 6.0, ()))], + dtype=[('a', int), ('b', [('ba', float), ('bb', int), ('bc', [])])]) self.data = (w, x, y, z) def test_solo(self): @@ -452,8 +452,8 @@ class TestMergeArrays(object): test = merge_arrays((x, w), flatten=False) controldtype = [('f0', int), ('f1', [('a', int), - ('b', [('ba', float), ('bb', int)])])] - control = np.array([(1., (1, (2, 3.0))), (2, (4, (5, 6.0)))], + ('b', [('ba', float), ('bb', int), ('bc', [])])])] + control = np.array([(1., (1, (2, 3.0, ()))), (2, (4, (5, 6.0, ())))], dtype=controldtype) assert_equal(test, control) |