Open dag opened 13 years ago
Maybe mess with the message as well:
assert something, """
{something} is str.formatted using locals() and processed with textwrap/cleandoc
to allow line-wrapping and indenting without messing up the resulting message.
"""
although this could technically be done by just catching the AssertionError and getting the frame from the traceback, possibly in a context manager or an excepthook.
Not sure if useful, but here goes:
AST/Import hook for transforming assertions to substitute for alternative behavior.