-
Notifications
You must be signed in to change notification settings - Fork 37
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
When a snapshot test is marked with skip
or skipif
syrupy exits with a failure exit code
#842
Comments
You can use the
I do have some gripes with how snapshots interact with skipped tests. I have a test relying on an external api request whose results I snapshot. I mark this test to be skipped because I only wish to run this test occasionally to test my integration with said external api. There's a couple problems:
Edit Just found issue #787 which is my problem 2 ^ |
Maybe you can use pytest-recording to cache the response? |
🎉 This issue has been resolved in version 4.6.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Describe the bug
If a snapshot test is skipped because it was marked with
pytest.mark.skip
or withpytest.mark.skipif
, syrupy will:To reproduce
Mark a test with
pytest.mark.skip
.Expected behavior
The test run shouldn't terminate with an error.
(It's ok that the snapshots that weren't used because the tests were skipped are reported as unused, but that currently happens with a red [error] message.
It would potentially make sense to count skipped tests separately from truly unused ones...)
Screenshots
Environment (please complete the following information):
Additional context
We have some snapshot tests that can only run on Python versions below 3.12, so we'd like to skip some snapshot tests if the Python version is 3.12.
The text was updated successfully, but these errors were encountered: