Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save bytes/str snapshot in a file directly #157

Open
shamrin opened this issue Feb 11, 2021 · 0 comments
Open

Save bytes/str snapshot in a file directly #157

shamrin opened this issue Feb 11, 2021 · 0 comments

Comments

@shamrin
Copy link

shamrin commented Feb 11, 2021

I would like to test a code that produces PNG file as bytes. Snapshot should be saved as PNG file directly. GitHub PRs would become super useful, because I can compare pictures directly just by looking at them:

github image diff demo

There is FileSnapshot functionality, but it's not directly useful for my case. FileSnapshot requires file path as an argument. I need to assert file content. Temporary file would work, but seems a bit extra and probably slower.

It would be cool to have something like snapshot.assert_match(png_content, save_as='.png').

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant