[Python-ideas] unittest.failureExeption(msg, data=None): add optional data kwarg to failureException() of unittest

Thomas Güttler guettliml at thomas-guettler.de
Tue Mar 3 09:33:18 CET 2015


Hi,

what do you think about the idea to add an optional data kwarg to unittest.failureExeption()?

Up to now a the exception class "failureException" does only get a message which is a string.

I would like to log the failed Exceptions to a structured logging back end.

Parsing the string message to extract the real value is possible, but somehow ugly and error prone.

My high level use case: Have a system (maybe ELK-Stack) to investigate if a test failure was seen before.

Doing this on strings could work, but I would like to keep the original (json serializable) values.

What do you think?

   Thomas Güttler


More information about the Python-ideas mailing list