diff --git a/modern_di_aiogram/main.py b/modern_di_aiogram/main.py index 7438189..bdd0cba 100644 --- a/modern_di_aiogram/main.py +++ b/modern_di_aiogram/main.py @@ -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] diff --git a/tests/test_example.py b/tests/test_example.py index b127044..5f11363 100644 --- a/tests/test_example.py +++ b/tests/test_example.py @@ -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)