MCPcopy
hub / github.com/numpy/numpy / test_simple_items

Method test_simple_items

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

Source from the content-addressed store, hash-verified

987 assert_raises(AssertionError, lambda: self._assert_func(y, x))
988
989 def test_simple_items(self):
990 x = 1.1
991 y = 2.2
992
993 self._assert_func(x, y)
994 expected_msg = ('Mismatched elements: 1 / 1 (100%)\n'
995 'Max absolute difference among violations: 1.1\n'
996 'Max relative difference among violations: 1.')
997 with pytest.raises(AssertionError, match=re.escape(expected_msg)):
998 self._assert_func(y, x)
999
1000 y = np.array([2.2, 3.3])
1001
1002 self._assert_func(x, y)
1003 assert_raises(AssertionError, lambda: self._assert_func(y, x))
1004
1005 y = np.array([1.0, 3.3])
1006
1007 assert_raises(AssertionError, lambda: self._assert_func(x, y))
1008
1009 def test_simple_items_and_array(self):
1010 x = np.array([[621.345454, 390.5436, 43.54657, 626.4535],

Callers

nothing calls this directly

Calls 2

_assert_funcMethod · 0.95
assert_raisesFunction · 0.90

Tested by

no test coverage detected