Feature I'm working on for pytest-check: `check.set_fail_function()`

I'm not sure about the name, so I might release it as an "experimental" feature. Anyone got a better name? or like this name?

What's it do?
Allows you to pass in a function that takes a string, and then pytest-check calls it whenever something fails.

Like: set_fail_function(print) for real time stdout printing.
Or: set_fail_function(logging.error) to go to logging system.

Thoughts on the name? or the general concept?

Follow

@brianokken I think something like `set_error_logger` or `set_failure_logger` or something.

Importantly, you probably shouldn't call it anything with `_function`, since that doesn't really explain what kind of function or the purpose of the function in any way.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.