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
4 changes: 2 additions & 2 deletions modern_di_aiogram/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def sync_wrapper(*args: typing.Any, **kwargs: typing.Any) -> T: # noqa: ANN401
wrapper = sync_wrapper

# NOT functools.wraps: aiogram unwraps __wrapped__ and would defeat __signature__.
wrapper.__name__ = func.__name__ # ty: ignore[unresolved-attribute]
wrapper.__qualname__ = func.__qualname__ # ty: ignore[unresolved-attribute]
wrapper.__name__ = func.__name__ # ty: ignore[missing-attribute]
wrapper.__qualname__ = func.__qualname__ # ty: ignore[missing-attribute]
wrapper.__doc__ = func.__doc__
wrapper.__module__ = func.__module__
wrapper.__signature__ = original_signature.replace(parameters=visible_params) # ty: ignore[invalid-assignment]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async def fake_call(
method: TelegramMethod[typing.Any],
_request_timeout: int | None = None,
) -> None:
sent["text"] = method.text # type: ignore[attr-defined] # ty: ignore[unresolved-attribute]
sent["text"] = method.text # type: ignore[attr-defined] # ty: ignore[missing-attribute]

# Only the transport (Bot's outgoing API call) is a double; DI resolution below is real.
monkeypatch.setattr(Bot, "__call__", fake_call)
Expand Down
Loading