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

Method test_rank3

numpy/testing/tests/test_utils.py:971–987  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

969 assert_raises(AssertionError, lambda: self._assert_func(y, x))
970
971 def test_rank3(self):
972 x = np.ones(shape=(2, 2, 2))
973 y = np.ones(shape=(2, 2, 2)) + 1
974
975 self._assert_func(x, y)
976 assert_raises(AssertionError, lambda: self._assert_func(y, x))
977
978 y[0, 0, 0] = 0
979 expected_msg = ('Mismatched elements: 1 / 8 (12.5%)\n'
980 'Mismatch at index:\n'
981 ' [0, 0, 0]: 1.0 (x), 0.0 (y)\n'
982 'Max absolute difference among violations: 1.\n'
983 'Max relative difference among violations: inf')
984 with pytest.raises(AssertionError, match=re.escape(expected_msg)):
985 self._assert_func(x, y)
986
987 assert_raises(AssertionError, lambda: self._assert_func(y, x))
988
989 def test_simple_items(self):
990 x = 1.1

Callers

nothing calls this directly

Calls 2

_assert_funcMethod · 0.95
assert_raisesFunction · 0.90

Tested by

no test coverage detected