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

fix: avoid reporting crash for snapshot dir outside pytest dir #621

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

huonw
Copy link
Contributor

@huonw huonw commented Sep 20, 2022

Description

This makes the formatting code for the unused snapshots less strict, to stop the detailed reporting (e.g. --snapshot-details or --snapshot-update) crashing when there's unused snapshots in a directory that's outside the main pytest session root directory.

The display is less good when this comes up, since it's the full path, rather than trimmed to a more relevant section, but it's better than crashing entirely!

Related Issues

Checklist

  • This PR has sufficient documentation.
  • This PR has sufficient test coverage.
  • This PR title satisfies semantic convention.

Additional Comments

No additional comments.

@noahnu noahnu self-assigned this Sep 20, 2022
Copy link
Collaborator

@noahnu noahnu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution 🎉

@noahnu noahnu merged commit f2b2e77 into tophat:master Sep 20, 2022
tophat-opensource-bot pushed a commit that referenced this pull request Sep 20, 2022
## [3.0.1](v3.0.0...v3.0.1) (2022-09-20)

### Bug Fixes

* avoid reporting crash for snapshot dir outside pytest dir ([#621](#621)) ([f2b2e77](f2b2e77))
@tophat-opensource-bot
Copy link
Collaborator

🎉 This PR is included in version 3.0.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@huonw huonw deleted the bugfix/620-outside-directory-reporting branch September 20, 2022 21:15
@huonw
Copy link
Contributor Author

huonw commented Sep 20, 2022

Yay, thanks!

tophat-opensource-bot pushed a commit that referenced this pull request Sep 23, 2022
## [3.0.1](v3.0.0...v3.0.1) (2022-09-23)

### Bug Fixes

* avoid reporting crash for snapshot dir outside pytest dir ([#621](#621)) ([f2b2e77](f2b2e77))
@tophat-opensource-bot
Copy link
Collaborator

🎉 This PR is included in version 3.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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