fixup! Add support for Fast Stream Depends

This commit is contained in:
AndrianEquestrian 2025-06-15 14:56:55 +03:00
parent 977e706250
commit be7078387c
3 changed files with 5 additions and 19 deletions

View File

@ -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

View File

@ -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

View File

@ -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