This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / testing / _private / utils / print_assert_equal

function

numpy.testing._private.utils:print_assert_equal

source: build-install/usr/lib/python3.14/site-packages/numpy/testing/_private/utils.py :466

Signature

def   print_assert_equal ( test_string actual desired )

Summary

Test if two objects are equal, and print an error message if test fails.

Extended Summary

The test is performed with actual == desired.

Parameters

test_string : str

The message supplied to AssertionError.

actual : object

The object to test for equality against desired.

desired : object

The expected result.

Examples

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])

Aliases

  • numpy.testing.print_assert_equal