-
Notifications
You must be signed in to change notification settings - Fork 14
enter_scope when using @inject. #189
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
Conversation
To-do:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR introduces an "enter_scope" parameter to the dependency injection decorator, allowing the injected function to automatically enter the specified context. Key changes include updating the injection logic in injection.py, adjusting tests to cover new behavior for synchronous, asynchronous, and generator functions, and revising documentation to reflect the new usage.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
that_depends/injection.py | Added the "enter_scope" parameter and corresponding error checks in the injection logic. |
tests/test_injection.py | Updated and added new tests to verify the behavior of the "enter_scope" flag. |
docs/migration/v3.md | Updated migration instructions to use "enter_scope=True" instead of the former container_context pattern. |
docs/introduction/scopes.md | Revised documentation to clarify that the scope is not entered by default. |
No description provided.