I\'m using pytest for my selenium tests and wanted to know if it\'s possible to have multiple assertions in a single test?
I call a function that compares multiple v
Here's an alternative approach called Delayed assert, It pretty much similar to what @Tryph has provided, and gives better stack trace.
The delayed-assert package on PyPI implements this approach. See also the pr4bh4sh/python-delayed-assert repository on GitHub, or install from PyPI using:
pip install delayed-assert
You can use (possibly) any assertion library in combination with python-delayed-assert. Consider it more like a stack trace manager library rather than an assertion. Check this for example uses
This is how the error stack trace looks,