-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm not able to test my injectable class #146
Comments
Ugh, sorry, I forgot to remove this part of the documentation. def test_username(self):
injector = Injector(UsernameModule())
assert injector.get('str') == 'Maria' |
@jstasiak It would look like this: from injector import Module, Injector, inject? |
Yup |
@jstasiak Could you update the documentation, please? I'm doing a task to insert the unit tests in the project kkkkk |
Why is this issue closed? The docs in master are still incorrect: https://github.com/alecthomas/injector/blob/master/docs/testing.rst |
because of @with_injector gone according to python-injector#146 Reported also on python-injector#220
because of @with_injector gone according to python-injector#146 Reported also on python-injector#220
Versions:
Problem:
I am looking to test a service which has the inject annotation in its constructor to be injectable. However, I am not able to test it. According to the documentation I need to do this:
import unittest
from injector import Module, with_injector, inject
But copying and pasting this code without touching anything, gives the following problem:
Can anybody help me?
The text was updated successfully, but these errors were encountered: