I have looked at the other related questions here but have not found my answer. I would like to simplify the output of my Python (2.7) unittests. Trying sys.tracebackl
unittest
has a mechanism for hiding the contents of the TestCase.assert*
methods in the traceback, as those really don't contain any useful information for failures. It looks for __unittest
in the frame's globals.
You can hide an entire module from the tracebacks by putting __unittest = True
at the top of the module.