numpy.testing.assert_string_equal
-
testing.assert_string_equal(actual, desired)[source] -
Проверка равенства двух строк.
Если заданные строки равны,
assert_string_equalничего не делает. Если они не равны, возникает исключение AssertionError, и отображается разность между строками.- Параметры
-
-
actualstr -
Строка, для проверки равенства с ожидаемой строкой.
-
desiredstr -
Ожидаемая строка.
-
Примеры
>>> np.testing.assert_string_equal('abc', 'abc') >>> np.testing.assert_string_equal('abc', 'abcd') Traceback (most recent call last): File "<stdin>", line 1, in <module> ... AssertionError: Differences in strings: - abc+ abcd? +
© 2005–2021 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.20/reference/generated/numpy.testing.assert_string_equal.html