def new_impl(self): target = 'cupy.core._fusion_trace.TraceImpl' with mock.patch(target, CreateMock(target)) as m: numpy_result = impl(self, numpy, m) with mock.patch(target, CreateMock(target)) as m: cupy_result = impl(self, cupy, m) testing.assert_array_list_equal(numpy_result, cupy_result)
def test_inequality_numpy(self): self.xs[0] += 1 with self.assertRaises(AssertionError): testing.assert_array_list_equal(self.xs, self.ys)
def test_equality_numpy(self): testing.assert_array_list_equal(self.xs, self.ys)
def test_inequality_numpy(self): self.xs[0] += 1 with six.assertRaisesRegex(self, AssertionError, '^\nArrays are not equal'): testing.assert_array_list_equal(self.xs, self.ys)