joseph-roitman / pytest-snapshot

A plugin for snapshot testing with pytest.
MIT License
117 stars 12 forks source link

Differences to syrusakbary/snapshottest #22

Closed opcode81 closed 3 years ago

opcode81 commented 3 years ago

How does this project differ from syrusakbary/snapshottest, which seems to offer the same functionality but has been developed since 2017. Any differences in the feature set that could perhaps be mentioned in the README?

joseph-roitman commented 3 years ago

I wrote this package because I felt that snapshottest was too opinionated and not easily customizable. For example, I wanted to save large json objects in separate files in YAML format in a logical path in the git repository which would make viewing diffs as easy as possible. I had trouble getting this to work.

In pytest-snapshot every snapshot is in a separate file, you serialize the object however you want, and you have complete control over the path to the snapshot. In my opinion, this makes the library more customizable and intuitive due to its simplicity.

Does this answer your question? Do you think I should add a paragraph to the README?

patbakdev commented 3 years ago

Since they are so similar, I think adding a note to the README would be nice. I was reconstituting an old project that used snapshottest and accidentally installed pytest-snapshot. The usage pattern was very similar. When the test failed due to a missing parameter tried to find out what was going on and what the differences were. There was not a lot of info based on my searches. I was going to just re-install snapshottest until I saw this comment.

opcode81 commented 3 years ago

I concur. Explaining the point behind this newer project would be useful to those trying to decide which library to apply.

joseph-roitman commented 3 years ago

I created a pull request which adds this to the readme. Feel free to add any suggestions to the documentation.