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
I'm snapshot testing a text file that gets generated in memory. The returned value is bytes. When a value is bytes, it currently is always on one line, like this:
b'HEADER\r\ncontent'
It would be nice if bytes could be multiline, similar to strings, like this:
b'''HEADER\rcontent'''
Of course, there are going to be bytes that are binary and don't really contain any readable text to format. Perhaps .isalnum() can be used as a best guess if the bytes are text that should be multiline vs binary that should not be multiline.
The current workaround is to just decode the bytes to a string first so that the snapshot test is prettier. However, ideally, I feel that there shouldn't be any "processing" between the actual value and the tested/asserted value.
The text was updated successfully, but these errors were encountered:
I'm snapshot testing a text file that gets generated in memory. The returned value is
bytes
. When a value isbytes
, it currently is always on one line, like this:b'HEADER\r\ncontent'
It would be nice if bytes could be multiline, similar to strings, like this:
Of course, there are going to be bytes that are binary and don't really contain any readable text to format. Perhaps
.isalnum()
can be used as a best guess if the bytes are text that should be multiline vs binary that should not be multiline.The current workaround is to just decode the bytes to a string first so that the snapshot test is prettier. However, ideally, I feel that there shouldn't be any "processing" between the actual value and the tested/asserted value.
The text was updated successfully, but these errors were encountered: