Skip to content

Why does redefining an argument raise an error? #49

@aballet

Description

@aballet

Hello,

I'm wondering why the re-definition of an argument raises an error?

I have this use case in mind: I find it elegant to inject a provider in a method's arguments, but I would love to override it in my unit tests by simply giving a mock as an argument. So far, I was able to do that with dependency-injector which I'm trying to replace, so I was wondering if I was missing the reason behind this error raising?

I'm thinking about defining my own inject to bypass this behavior; maybe it could be a parameter of the decorator?

Adrien.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions