Skip to content

Save bytes/str snapshot in a file directly #157

@shamrin

Description

@shamrin

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions