python-injector / python-injector/injector

Pytest integration

Open
#114 8 comments 5 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.