-
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
Unused snapshot falsely detected when tests have same names #529
Comments
Thanks for reporting this issue. I have a fix in #531, just validating the correctness. |
Unfortunately my first attempt didn't work. This is difficult since we make no assumptions around the extension being used (ambr vs. another extension). I've updated my PR with some more test coverage which has at least given me confidence that my first approach doesn't work. I'll give this some more thought. |
🎉 This issue has been resolved in version 1.4.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Describe the bug
If a test in one test file has the same name as a test in another test file, and both try to do a snapshot, if we run pytest but deselect one of those tests then pytest fails erroneously saying that a snapshot is obsolete.
To reproduce
Create two test files (
test_a.py
andtest_b.py
) with the following contents:Create the snapshots:
Attempt to run all but
test_b.py::test_name
:Result: pytest exits with status 1 saying:
Expected behavior
pytest should exit successfully and we shouldn't be told a snapshot is unused, because we didn't run the test that used it.
Screenshots
Should be clear from above.
Environment (please complete the following information):
Additional context
None
The text was updated successfully, but these errors were encountered: