(self)
| 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 |
nothing calls this directly
no test coverage detected