Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest and pytest-xdist plugin with --snapshot-update -n auto deletes all snapshots on parallel executions #9600

Closed
Sharu95 opened this issue Feb 3, 2022 · 1 comment
Labels

Comments

@Sharu95
Copy link

Sharu95 commented Feb 3, 2022

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 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 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

  1. Create initial snapshots with pytest --snapshot-update
  2. Add a new test to the test-file
  3. Run pytest --snapshot-update -n auto to run tests in parallel, which deletes snapshots

Screenshot of steps
steps to reproduce

System information

Name Version
python 3.7.12
pip 21.3.1
syrupy 1.7.3
pytest-xdist 2.5.0
pytest 6.2.5
MacBook Pro 2016 MacOS Big Sur 11.6

piplist.txt
requirements.txt
Full code/minimum example: codebase.zip

@RonnyPfannschmidt RonnyPfannschmidt added invalid status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity and removed status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity labels Feb 3, 2022
@RonnyPfannschmidt
Copy link
Member

duplicate of syrupy-project/syrupy#535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants