python-injector / python-injector/injector
Pytest integration
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
How would one use this library with pytest without actually doing
def test_something(injector):
dependency = injector.get(Class)
It'd be nice if I could use the injector with pytest.
@inject
def test_something(dependency : Class):
pass
(I get that using a type annotation is probably not possible)
Does anyone have any nice patterns for this that don't break the pytest paradigm.
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.
Research direction
The issue names pytest and the library's injector API but no repository files, tests, or entry points. Start by reviewing pytest's fixture model alongside the documented injection API, then define a concrete supported integration and acceptance tests for the requested usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100