diff --git a/tests/gateway/test_35809_auto_reset_clean_context.py b/tests/gateway/test_35809_auto_reset_clean_context.py index bf753cc7528..4bc2ef40dc5 100644 --- a/tests/gateway/test_35809_auto_reset_clean_context.py +++ b/tests/gateway/test_35809_auto_reset_clean_context.py @@ -85,6 +85,10 @@ class TestAutoResetBlockReSyncsBinding: for stmt in ast.walk(block): if isinstance(stmt, ast.Assign): val = stmt.value + # reset_session is async at the gateway boundary, so the + # assignment value is Await(Call(...)), not a bare Call. + if isinstance(val, ast.Await): + val = val.value if ( isinstance(val, ast.Call) and isinstance(val.func, ast.Attribute)