tophat / syrupy

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

`syrupy` is incompatible with `pytest-flakefinder` #771

Open jrandolf opened 1 year ago

jrandolf commented 1 year ago

Describe the bug

Can run pytests with flakefinder and syrupy.

To reproduce

Steps to reproduce the behavior:

  1. Create a test with syrupy and update the snapshots
  2. Run pytest test_file.py --flake-finder
  3. See error

Expected behavior

Tests should pass.

Environment (please complete the following information):

Additional context

Syrupy tracks each iteration of a test run by flake finder resulting in a bunch of indexing. A fix would be having a "global name" for the snapshot, one that doesn't rely on the test name (but does rely on the file)

noahnu commented 11 months ago

You may be able to work around this by specifying a custom name rather than relying on the default auto-incremented execution id. See the example in the README: https://github.com/tophat/syrupy#name