With the help of @flub and @obestwalter, we were able to find an easy way to simplify the output of assertion failures to something like this, while keeping the old behavior same as before for unbounded objects:
=================================== FAILURES ===================================
_____________________________________ test _____________________________________
def test():
> assert Help().fun() == 2
E assert 1 == 2
E + where 1 = fun()
E + where fun = <test_local.Help object at 0x1074be230>.fun
E + where <test_local.Help object at 0x1074be230> = Help()
test_local.py:13: AssertionError
=========================== 1 failed in 0.03 seconds ===========================
However, I opened an issue (#12499) to refactor the data structure of assertions AST (in rewerite.py) from string to something more flexible.
Closes #389
With the help of @flub and @obestwalter, we were able to find an easy way to simplify the output of assertion failures to something like this, while keeping the old behavior same as before for unbounded objects:
However, I opened an issue (#12499) to refactor the data structure of assertions AST (in
rewerite.py
) from string to something more flexible.