numpy.testing.print_assert_equal
- testing.print_assert_equal(test_string, actual, desired)[source]
-
Проверка, что два объекта равны, и вывод сообщения об ошибке, если тест не пройден.
Проверка выполняется с помощью
actual == desired.- Параметры:
-
- test_stringstr
-
Сообщение, передаваемое в AssertionError.
- actualobject
-
Объект, который нужно проверить на равенство с
desired. - desiredobject
-
Ожидаемый результат.
Примеры
>>> np.testing.print_assert_equal('Test XYZ of func xyz', [0, 1], [0, 1]) >>> np.testing.print_assert_equal('Test XYZ of func xyz', [0, 1], [0, 2]) Traceback (most recent call last): ... AssertionError: Test XYZ of func xyz failed ACTUAL: [0, 1] DESIRED: [0, 2]
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.0/reference/generated/numpy.testing.print_assert_equal.html