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

Method test_get_names

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

Source from the content-addressed store, hash-verified

106 assert_equal(test, control)
107
108 def test_get_names(self):
109 # Test get_names
110 ndtype = np.dtype([('A', '|S3'), ('B', float)])
111 test = get_names(ndtype)
112 assert_equal(test, ('A', 'B'))
113
114 ndtype = np.dtype([('a', int), ('b', [('ba', float), ('bb', int)])])
115 test = get_names(ndtype)
116 assert_equal(test, ('a', ('b', ('ba', 'bb'))))
117
118 ndtype = np.dtype([('a', int), ('b', [])])
119 test = get_names(ndtype)
120 assert_equal(test, ('a', ('b', ())))
121
122 ndtype = np.dtype([])
123 test = get_names(ndtype)
124 assert_equal(test, ())
125
126 def test_get_names_flat(self):
127 # Test get_names_flat

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
get_namesFunction · 0.85
dtypeMethod · 0.45

Tested by

no test coverage detected