Skip to content

fix: raise UserWarning when trying to wrap generators with container_context#198

Merged
xelandernt merged 2 commits into
mainfrom
container-context-with-generators
Aug 28, 2025
Merged

fix: raise UserWarning when trying to wrap generators with container_context#198
xelandernt merged 2 commits into
mainfrom
container-context-with-generators

Conversation

@xelandernt
Copy link
Copy Markdown
Collaborator

Makes the following raise a UserWarning

@container_context(...)
async def my_generator(...):
    yield

Since @container_context() does not support generators.

@xelandernt xelandernt self-assigned this Aug 26, 2025
@xelandernt xelandernt added the bug Something isn't working label Aug 26, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 26, 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/providers/test_context_resources.py 100.00% <100.00%> (ø)
that_depends/providers/context_resources.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xelandernt xelandernt merged commit 12c7d00 into main Aug 28, 2025
6 checks passed
@xelandernt xelandernt deleted the container-context-with-generators branch September 24, 2025 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant