If I could somehow trigger pytest_assertrepr_compare() so it would receive
op=None, left=myresult, right=None (or something similar), then I could
handle failing cases by getting the needed information from a property of a
Falsy return value.

I'm also wondering: might it be possible to use pytest_addhooks() to add a
hook to modify the AST or even modify the pre-parsed source? If I could
automatically re-write "assert myfunc(myobj)" but leave other cases
unchanged, this would clean things up for me. Although as I mentioned
earlier, I don't see a way to interact with the AST or the
AssertionRewriter within pytest's plugin system.
_______________________________________________
pytest-dev mailing list
pytest-dev@python.org
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to