Skip to content

Support injection for generators. #187

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

Merged
merged 10 commits into from
May 2, 2025
Merged

Support injection for generators. #187

merged 10 commits into from
May 2, 2025

Conversation

alexanderlazarev0
Copy link
Collaborator

Resolves #186

@alexanderlazarev0 alexanderlazarev0 linked an issue Apr 30, 2025 that may be closed by this pull request
@alexanderlazarev0 alexanderlazarev0 self-assigned this Apr 30, 2025
@alexanderlazarev0 alexanderlazarev0 added the enhancement New feature or request label Apr 30, 2025
Copy link

codecov bot commented Apr 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tests/test_injection.py 100.00% <100.00%> (ø)
that_depends/injection.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexanderlazarev0 alexanderlazarev0 marked this pull request as ready for review May 2, 2025 09:28
@alexanderlazarev0 alexanderlazarev0 requested a review from Copilot May 2, 2025 09:28
Copy link

@Copilot Copilot AI left a 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 resolves #186 by adding support for dependency injection into generator functions (both synchronous and asynchronous) and by enhancing error handling for context resources. Key changes include:

  • Adding specialized injector functions for sync and async generators in injection.py.
  • Expanding tests to cover various generator injection scenarios and error conditions.
  • Updating documentation and navigation to reflect the new generator injection support.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
that_depends/injection.py Introduces ContextProviderError and new injection paths for generator functions.
tests/test_injection.py Adds new tests for sync/async generator injection and context resource error handling.
mkdocs.yml Updates navigation by adding generator injection docs and rearranging duplicate entries.
docs/introduction/generator-injection.md Provides detailed documentation on using dependency injection with generators.
docs/integrations/fastapi.md Minor grammar adjustment in FastAPI integration documentation.
docs/introduction/application-settings.md Removes outdated application settings doc.

@alexanderlazarev0 alexanderlazarev0 merged commit 5c9a7a7 into main May 2, 2025
6 checks passed
@alexanderlazarev0 alexanderlazarev0 deleted the 186 branch May 3, 2025 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generator injection
1 participant