From 7b2918ad6e8047a27279cae1de195bc704e66888 Mon Sep 17 00:00:00 2001 From: redshift <213178690+1ftredsh@users.noreply.github.com> Date: Tue, 8 Sep 2026 17:00:15 +0200 Subject: [PATCH] fix(types): narrow await_args for mypy in x-cashu key-config test uv run mypy . failed with union-attr on store_mock.await_args.kwargs (AsyncMock.await_args is typed _Call | None, and assert_awaited_once() does not narrow it). Add an explicit None check before accessing kwargs. --- tests/unit/test_tinfoil_integration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/test_tinfoil_integration.py b/tests/unit/test_tinfoil_integration.py index 1058a19a..1319e5a0 100644 --- a/tests/unit/test_tinfoil_integration.py +++ b/tests/unit/test_tinfoil_integration.py @@ -1028,6 +1028,7 @@ async def test_x_cashu_key_config_422_refunds_and_sets_x_cashu_header() -> None: ) # The redemption itself was recorded. store_mock.assert_awaited_once() + assert store_mock.await_args is not None assert store_mock.await_args.kwargs.get("typ") == "in" # Passthrough shape with the refund attached. assert response.status_code == 422