MCPcopy Index your code
hub / github.com/numpy/numpy / test_autoconversion

Method test_autoconversion

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

Source from the content-addressed store, hash-verified

743 assert_equal(test.mask, control.mask)
744
745 def test_autoconversion(self):
746 # Tests autoconversion
747 adtype = [('A', int), ('B', bool), ('C', float)]
748 a = ma.array([(1, 2, 3)], mask=[(0, 1, 0)], dtype=adtype)
749 bdtype = [('A', int), ('B', float), ('C', float)]
750 b = ma.array([(4, 5, 6)], dtype=bdtype)
751 control = ma.array([(1, 2, 3), (4, 5, 6)], mask=[(0, 1, 0), (0, 0, 0)],
752 dtype=bdtype)
753 test = stack_arrays((a, b), autoconvert=True)
754 assert_equal(test, control)
755 assert_equal(test.mask, control.mask)
756 with assert_raises(TypeError):
757 stack_arrays((a, b), autoconvert=False)
758
759 def test_checktitles(self):
760 # Test using titles in the field names

Callers

nothing calls this directly

Calls 3

stack_arraysFunction · 0.90
assert_equalFunction · 0.90
assert_raisesFunction · 0.90

Tested by

no test coverage detected