Currently working on optimizing some pipelines where I discovered that pytest + pytest-xdist behaves different with the -n flag combined with --snapshot-update. The issue arised while using tox, but is replicated with only pytest, pytest-xdist and syrupy. A minimal codebase is provided to replicate the results further down.
Actual outcome
All snapshots (new and old) are deleted when tests are run with --snapshot-update -n autoExpected outcome
All old snapshots should not be deleted and a new snapshot should be added with --snapshot-update -n auto
Steps to reproduce
Create initial snapshots with pytest --snapshot-update
Add a new test to the test-file
Run pytest --snapshot-update -n auto to run tests in parallel, which deletes snapshots
Description
Currently working on optimizing some pipelines where I discovered that pytest + pytest-xdist behaves different with the
-n
flag combined with--snapshot-update
. The issue arised while usingtox
, but is replicated with onlypytest
,pytest-xdist
andsyrupy
. A minimal codebase is provided to replicate the results further down.Actual outcome All snapshots (new and old) are deleted when tests are run with
--snapshot-update -n auto
Expected outcome All old snapshots should not be deleted and a new snapshot should be added with--snapshot-update -n auto
Steps to reproduce
pytest --snapshot-update
pytest --snapshot-update -n auto
to run tests in parallel, which deletes snapshotsScreenshot of steps![steps to reproduce](https://user-images.githubusercontent.com/14542723/152400673-8a6889c4-beb4-4206-9767-40ee4827e9b7.png)
System information
piplist.txt requirements.txt Full code/minimum example: codebase.zip