-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Hi,
I am writing some reporting plugin for pytest and I find important that it mentions the assertions on the test, basically saying that it passed and the values involved in the comparison.
Because assert
is a statement, we cannot override it or monkey patch to make it run custom reporting code. I also don't want to resort to unittest-style assertion functions as the purpose of pytest after all is making as much boilerplate free as possible.
So I was wondering if pytest has/could have some sort of hook that would be called whenever we have a passing assertion on the test, with the same assertion introspection information as showed when an assertion fails. I suppose this would have do be done around the assertion rewriting.
Can it be done right now with current features and, if not, could you give some directions on where to look for? If my abilities are enough for this I would be willing code it and make a PR if you think it is a worthy feature and everything goes fine.
Thanks!