Skip to content

Commit be70783

Browse files
fixup! Add support for Fast Stream Depends
1 parent 977e706 commit be70783

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

docs/examples/fastdepends.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ Just use it within ``Depends``
4747
container = Container()
4848
container.wire(modules=[sys.modules[__name__]])
4949
50-
assert apply_coefficient(100) == 120.0
50+
apply_coefficient(100) == 120.0
5151
5252

tests/unit/samples/wiringfastdepends/sample.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
1-
from dependency_injector.wiring import inject, Provide
2-
from fast_depends import Depends
3-
4-
# Runtime import to avoid syntax errors in samples on Python < 3.5 and reach top-dir
5-
import os
6-
7-
_SAMPLES_DIR = os.path.abspath(
8-
os.path.sep.join(
9-
(
10-
os.path.dirname(__file__),
11-
"../samples/",
12-
)
13-
),
14-
)
151
import sys
162

17-
sys.path.append(_SAMPLES_DIR)
18-
19-
3+
from dependency_injector.wiring import inject, Provide
4+
from fast_depends import Depends
205
from wiringfastdepends.sample import CoefficientService, Container
216

227

tests/unit/wiring/test_fastdepends.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ def apply_coefficient(
2727
container = Container()
2828
container.wire(modules=[sys.modules[__name__]])
2929

30-
assert apply_coefficient(100) == 120.0
30+
def test_apply_coefficient():
31+
assert apply_coefficient(100) == 120.0

0 commit comments

Comments
 (0)