I'm writing tests using pytest, on an application that uses sqlalchemy. When the application does something wrong that triggers an uncaught exception deep in the sqlalchemy call stack, we get an enormous stack trace, the majority of which isn't helpful for understanding the cause of the failure.
Is it possible to configure pytest to filter off parts of the stack trace that are in specific 3rd party modules? That way, when an exception is raised, the pytest report would draw our attention more directly to the parts of our code that cause the failure.