Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions injection/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ class Module:
mode: Mode | ModeStr = ...,
) -> Any:
"""
Decorator applicable to a class or function. It is used to indicate how the
constant is constructed. At injection time, the injected instance will always
be the same. Unlike `@singleton`, dependencies will not be resolved.
Decorator applicable to a class. It is used to indicate how the constant is
constructed. At injection time, the injected instance will always be the same.
Unlike `@singleton`, dependencies will not be resolved.
"""

def set_constant[T](
Expand Down
2 changes: 1 addition & 1 deletion injection/ext/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@dataclass(eq=False, frozen=True, slots=True)
class FastAPIInject:
module: Module = field(default_factory=mod)
threadsafe: bool = field(default=False)
threadsafe: bool = field(default=False, kw_only=True)

def __call__[T](
self,
Expand Down
6 changes: 4 additions & 2 deletions tests/core/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ async def test_aget_instance_with_success_return_instance(self, module):
assert isinstance(instance, SomeClass)

async def test_aget_instance_with_no_injectable_return_not_implemented(
self, module
self,
module,
):
instance = await module.aget_instance(SomeClass)
assert instance is NotImplemented

async def test_aget_instance_with_empty_annotated_return_not_implemented(
self, module
self,
module,
):
instance = await module.aget_instance(Annotated)
assert instance is NotImplemented
Expand Down