Closed Le0nRoy closed 1 year ago
I'm not sure I'd like the complexity that would add to the code. However, I'm willing to consider, if you have an example of how it could be implemented.
I have made a small workaround in my project, that allows to print full assertions:
def soft_assert(msg: str = None):
"""
Wrapper over `pytest_check.check` that allows to print full
traceback instead of pseudo-traceback implemented in package
Should be used like:
with soft_assert():
assert False
```
:param msg: message that will be printed in the beginning of the trace
"""
try:
yield
except Exception as e:
exc_type = type(e)
exc_val = "".join(traceback.format_exception(exc_type, e, e.__traceback__))
with check(msg):
raise type(e)(exc_val)
It is not elegant solution, however it works. Later I will check how it could be implemented inside your lib as a flag
some changes coming in 2.2.0, not huge changes, but I'm incorporating the full traceback information
2.2.0 is published
Thank you!
Sometimes it is required to see all traces instead of pseudo-trace only. So it would be great to have possibility to configure what output should be printed