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

Method test_recarrays

numpy/testing/tests/test_utils.py:144–159  ·  view source on GitHub ↗

Test record arrays.

(self)

Source from the content-addressed store, hash-verified

142 self._test_not_equal(c, b)
143
144 def test_recarrays(self):
145 """Test record arrays."""
146 a = np.empty(2, [('floupi', float), ('floupa', float)])
147 a['floupi'] = [1, 2]
148 a['floupa'] = [1, 2]
149 b = a.copy()
150
151 self._test_equal(a, b)
152
153 c = np.empty(2, [('floupipi', float),
154 ('floupi', float), ('floupa', float)])
155 c['floupipi'] = a['floupi'].copy()
156 c['floupa'] = a['floupa'].copy()
157
158 with pytest.raises(TypeError):
159 self._test_not_equal(c, b)
160
161 def test_masked_nan_inf(self):
162 # Regression test for gh-11121

Callers

nothing calls this directly

Calls 3

_test_equalMethod · 0.80
_test_not_equalMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected