Question: Testing with injector
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- documentation, testing
Research direction
Start by reviewing the documentation for with_injector and the related testing entry points. Clarify the replacement for the deprecated usage and how a test can reference a mocked service; the issue is complete when both questions have an agreed, documented answer.
Written by the indexing model from the issue text.
Description
Hi,
Thanks for this great project, it adds really nice separation to my code. But now I want to unittest everything and there are two cases:
- In documentation you show that we should use
with_injectorbut it is depreciated and is spewing warnings in my tests - Using
with_injectorI create mock service and unittest component which uses this service. But I would like to assert that mocked service was called with correct parameters. How can I obtain reference to mocked service? For now it seems I have to accessself.__injector__which seems a little hacky. Is there another way? Is there planned another way?
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-injector/injector
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
python-injector/injector#317 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
python-injector/injector#298 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
python-injector/injector#297 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
python-injector/injector#267 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
python-injector/injector#258 · 3 comments ·
All issues in python-injector/injector
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#759 ·