Fix doctests in readme
This commit is contained in:
parent
ef1f9cba23
commit
ee73541329
15
README.md
15
README.md
|
@ -361,15 +361,18 @@ Traceback (most recent call last):
|
||||||
AttributeError: 'X' object has no attribute 'y'
|
AttributeError: 'X' object has no attribute 'y'
|
||||||
>>> x2._y
|
>>> x2._y
|
||||||
2
|
2
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note 2**: When class is decorated with `inject` decorator you need to use keyword arguments when instantiating the class manually:
|
**Note 2**: When class is decorated with `inject` decorator you need to use keyword arguments when instantiating the class manually:
|
||||||
|
|
||||||
```pycon
|
```pycon
|
||||||
>>> Item(name='computer') # that's ok
|
>>> x = X(y=2) # that's ok
|
||||||
<Item object at 0x10cb04210>
|
>>> x = X(2) # that'll result in a CallError
|
||||||
>>> Item('computer') # that'll result in a CallError
|
Traceback (most recent call last):
|
||||||
Traceback (...)
|
...
|
||||||
|
CallError: Keyword argument y not found
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Injector
|
### Injector
|
||||||
|
@ -658,9 +661,9 @@ By default ``injector`` logger is not configured to print logs anywhere.
|
||||||
To enable ``get()`` tracing you need to set ``injector`` logger level to ``DEBUG``. You can do that programatically by executing:
|
To enable ``get()`` tracing you need to set ``injector`` logger level to ``DEBUG``. You can do that programatically by executing:
|
||||||
|
|
||||||
```pycon
|
```pycon
|
||||||
import logging
|
>>> import logging
|
||||||
|
>>> logging.getLogger('injector').setLevel(logging.DEBUG)
|
||||||
|
|
||||||
logging.getLogger('injector').setLevel(logging.DEBUG)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Thread safety
|
Thread safety
|
||||||
|
|
Loading…
Reference in New Issue