Skip to content

Commit 6e66b75

Browse files
authored
refactoring: ♻️ Small changes
1 parent 684424d commit 6e66b75

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

injection/__init__.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ class Module:
178178
mode: Mode | ModeStr = ...,
179179
) -> Any:
180180
"""
181-
Decorator applicable to a class or function. It is used to indicate how the
182-
constant is constructed. At injection time, the injected instance will always
183-
be the same. Unlike `@singleton`, dependencies will not be resolved.
181+
Decorator applicable to a class. It is used to indicate how the constant is
182+
constructed. At injection time, the injected instance will always be the same.
183+
Unlike `@singleton`, dependencies will not be resolved.
184184
"""
185185

186186
def set_constant[T](

injection/ext/fastapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@dataclass(eq=False, frozen=True, slots=True)
1313
class FastAPIInject:
1414
module: Module = field(default_factory=mod)
15-
threadsafe: bool = field(default=False)
15+
threadsafe: bool = field(default=False, kw_only=True)
1616

1717
def __call__[T](
1818
self,

tests/core/test_module.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,15 @@ async def test_aget_instance_with_success_return_instance(self, module):
9090
assert isinstance(instance, SomeClass)
9191

9292
async def test_aget_instance_with_no_injectable_return_not_implemented(
93-
self, module
93+
self,
94+
module,
9495
):
9596
instance = await module.aget_instance(SomeClass)
9697
assert instance is NotImplemented
9798

9899
async def test_aget_instance_with_empty_annotated_return_not_implemented(
99-
self, module
100+
self,
101+
module,
100102
):
101103
instance = await module.aget_instance(Annotated)
102104
assert instance is NotImplemented

0 commit comments

Comments
 (0)