How to change the message in a Python AssertionError?
assert expression, info For instance, >>> assert False, “Oopsie” Traceback (most recent call last): File “<stdin>”, line 1, in <module> AssertionError: Oopsie From the docs: Assert statements are a convenient way to insert debugging assertions into a program: assert_stmt ::= “assert” expression [“,” expression] The simple form, assert expression, is equivalent to if __debug__: if … Read more