From b1da073677bd1259db50b2d3ff3c2da0cc55e2bd Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 6 Oct 2026 11:03:16 -0400 Subject: [PATCH] test(mcp): import only User locally; UserRole comes from the enclosing scope (#5035) The local import shadowed UserRole for the whole function, so its earlier use read an unassigned name (ruff F823, CI run 8294). Co-Authored-By: Claude Opus 5.5 --- tests/integration/test_mcp_plugin_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_mcp_plugin_tools.py b/tests/integration/test_mcp_plugin_tools.py index bea44a4..4dc3b68 100644 --- a/tests/integration/test_mcp_plugin_tools.py +++ b/tests/integration/test_mcp_plugin_tools.py @@ -255,7 +255,7 @@ def test_docker_and_agent_tools_over_seeded_rows(app): # ── the web pages say the same ───────────────────────────────────── # A real viewer: every request re-reads the session's user (refresh_session_user). - from steward.models.users import User, UserRole + from steward.models.users import User viewer_id = str(uuid.uuid4()) async with app.db_sessionmaker() as s, s.begin(): s.add(User(id=viewer_id, username=f"viewer-{viewer_id[:8]}", email=f"{viewer_id}@test",