mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-07-06 21:33:31 +03:00
fixup! Add support for Fast Stream Depends
This commit is contained in:
parent
977e706250
commit
be7078387c
|
@ -47,6 +47,6 @@ Just use it within ``Depends``
|
|||
container = Container()
|
||||
container.wire(modules=[sys.modules[__name__]])
|
||||
|
||||
assert apply_coefficient(100) == 120.0
|
||||
apply_coefficient(100) == 120.0
|
||||
|
||||
|
||||
|
|
|
@ -1,22 +1,7 @@
|
|||
from dependency_injector.wiring import inject, Provide
|
||||
from fast_depends import Depends
|
||||
|
||||
# Runtime import to avoid syntax errors in samples on Python < 3.5 and reach top-dir
|
||||
import os
|
||||
|
||||
_SAMPLES_DIR = os.path.abspath(
|
||||
os.path.sep.join(
|
||||
(
|
||||
os.path.dirname(__file__),
|
||||
"../samples/",
|
||||
)
|
||||
),
|
||||
)
|
||||
import sys
|
||||
|
||||
sys.path.append(_SAMPLES_DIR)
|
||||
|
||||
|
||||
from dependency_injector.wiring import inject, Provide
|
||||
from fast_depends import Depends
|
||||
from wiringfastdepends.sample import CoefficientService, Container
|
||||
|
||||
|
||||
|
|
|
@ -27,4 +27,5 @@ def apply_coefficient(
|
|||
container = Container()
|
||||
container.wire(modules=[sys.modules[__name__]])
|
||||
|
||||
assert apply_coefficient(100) == 120.0
|
||||
def test_apply_coefficient():
|
||||
assert apply_coefficient(100) == 120.0
|
Loading…
Reference in New Issue
Block a user