hide library lines in Python unittest failure tracebacks
If you write Python unit tests with the built in unittest module, here’s a code snippet you can add to your TestCase classes to hide lines in tracebacks from libraries in your virtualenv and Python itself: def run(self, result=None): “””Override to hide stdlib and virtualenv lines in tracebacks. https://docs.python.org/3.9/library/unittest.html#unittest.TestCase.run https://docs.python.org/3.9/library/unittest.html#unittest.TestResult “”” result = super().run(result=result) def […]