MCPcopy Create free account
hub / github.com/numpy/numpy / test_get_names_flat

Method test_get_names_flat

numpy/lib/tests/test_recfunctions.py:126–142  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

124 assert_equal(test, ())
125
126 def test_get_names_flat(self):
127 # Test get_names_flat
128 ndtype = np.dtype([('A', '|S3'), ('B', float)])
129 test = get_names_flat(ndtype)
130 assert_equal(test, ('A', 'B'))
131
132 ndtype = np.dtype([('a', int), ('b', [('ba', float), ('bb', int)])])
133 test = get_names_flat(ndtype)
134 assert_equal(test, ('a', 'b', 'ba', 'bb'))
135
136 ndtype = np.dtype([('a', int), ('b', [])])
137 test = get_names_flat(ndtype)
138 assert_equal(test, ('a', 'b'))
139
140 ndtype = np.dtype([])
141 test = get_names_flat(ndtype)
142 assert_equal(test, ())
143
144 def test_get_fieldstructure(self):
145 # Test get_fieldstructure

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
get_names_flatFunction · 0.85
dtypeMethod · 0.45

Tested by

no test coverage detected