tophat / syrupy

:pancakes: The sweeter pytest snapshot plugin
https://tophat.github.io/syrupy
Apache License 2.0
485 stars 33 forks source link

Add option to add non-existing snapshots instead of raising an error #843

Open claytonkreisel opened 6 months ago

claytonkreisel commented 6 months ago

Is your feature request related to a problem? Please describe.

The issue is that I have to run --snapshot-update in order to initiate a new assertion in a test. This is mostly an annoyance when testing with PyCharm using the IDE testing tools.

Describe the solution you'd like

I would prefer that there is an option that I can set by default that will not update any existing snapshots, but will add any newly created snapshots.

Describe alternatives you've considered

A flag called create-non-existing-snapshots as an option that can be set. This could then be configured in CLI or an IDE.

Additional context

None

tducret commented 5 months ago

Hi there! I have the same request 😄

On top of that, I think it would be a great way to onboard former snapshottest users, as creating non-existing snapshots without passing the --snapshot-update option is the default behavior in snapshottest.

Is there any chance we could implement that?