You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to improve output asserts and display of potential errors I need a generic way to sanitize captured output.
Please, keep in mind that the purpose of this is not to disable the ANSI support in the executed command but to assure that when asserts fail, they can be read by humans.
Is there something I can do to enable implicit sanitization?
How can I improve the assert error report to make it easier to read? Combining newlines like this makes it very difficult to read.
I should add that I know how to strip ANSI part, the question if there is a way to make this implicit as part of assert. Maybe a custom assert that does this?
The text was updated successfully, but these errors were encountered:
You're running str() on a bytes object, which gives you a string like that. Instead, you might want to properly decode it via something like e.value.stdout.decode('utf-8') (or if that's the subprocess module, pass the encoding argument to subprocess
I am more worried about how to improve pytest display of multiline string assert failures in pytest. The problem is still valid even without ANSI escapes.
In order to improve output asserts and display of potential errors I need a generic way to sanitize captured output.
Please, keep in mind that the purpose of this is not to disable the ANSI support in the executed command but to assure that when asserts fail, they can be read by humans.
I should add that I know how to strip ANSI part, the question if there is a way to make this implicit as part of assert. Maybe a custom assert that does this?
The text was updated successfully, but these errors were encountered: