-
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
fix: defer snapshot default extension import #734
Conversation
"-v", | ||
"--snapshot-update", | ||
"--snapshot-default-extension", | ||
"extension_file.MySingleFileExtensions", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this is a typo. The snapshot is successfully generated if I replace this with extension_file.MySingleFileExtension
, even though I haven't customized pythonpath
in this test case. This could mean project has been honoring pytest's import paths all along. I think this PR still fixes a bug, but I'm not sure the description is right. I converted this PR to draft. Let me investigate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured it out. A few lines above this comment from #667, there's an in-memory cache. I didn't quite grok why the cache is there, but assuming it is necessary, the test module in this PR now clears the cache between test cases. I fixed the typo on this line. Tests pass as expected, locally.
Tests are failing on windows |
I see. This'll be fun to track down without Windows. 😄 I'll noodle on it.
|
* Fix missing module in test
Fixes unable to use pytest's `pythonpath` option with this project's `--snapshot-default-extension` option. Does cause extension import errors to raise later than CLI argument parsing, and therefore emit on stdout, instead of stderr.
@all-contributors add @john-kurkowski for bug |
I've put up a pull request to add @john-kurkowski! 🎉 |
🎉 This PR is included in version 4.0.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Thanks for accepting the change and for the assist! |
Description
Fixes unable to use pytest's
pythonpath
option with this project's--snapshot-default-extension
option.Does cause extension import errors to raise later than CLI argument parsing, and therefore emit on stdout, instead of stderr.
Also fix shadowing
AttributeError
during import.Related Issues
--snapshot-default-extension
doesn't support pytest 7pythonpath
#719Checklist
Additional Comments
No additional comments.