numpy / 1.23 / reference / generated / numpy.testing.assert_.html

numpy.testing.assert_

testing.assert_(val, msg='')[source]

Assert that works in release mode. Accepts callable msg to allow deferring evaluation until failure.

The Python built-in assert does not work when executing code in optimized mode (the -O flag) - no byte-code is generated for it.

For documentation on usage, refer to the Python documentation.

© 2005–2022 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.23/reference/generated/numpy.testing.assert_.html