style: hoist test import to module top (PLC0415)

This commit is contained in:
Renn F
2026-06-04 02:27:12 +02:00
parent 48d6e99fa4
commit 0dc772a97f
+1 -2
View File
@@ -13,6 +13,7 @@ from unittest.mock import AsyncMock, MagicMock, patch
from uuid import uuid4 from uuid import uuid4
import pytest import pytest
from roboco.api.schemas.git import GitCreateBranchRequest
from roboco.config import settings from roboco.config import settings
from roboco.services.base import NotFoundError from roboco.services.base import NotFoundError
from roboco.services.git import GitService from roboco.services.git import GitService
@@ -306,8 +307,6 @@ async def test_create_branch_idempotent_when_branch_already_exists() -> None:
# A prior attempt may have created the branch on disk before the DB recorded # A prior attempt may have created the branch on disk before the DB recorded
# branch_name; `checkout -b` then fails 128. create_branch must switch to the # branch_name; `checkout -b` then fails 128. create_branch must switch to the
# existing branch instead of raising (the raise triggered a retry cascade). # existing branch instead of raising (the raise triggered a retry cascade).
from roboco.api.schemas.git import GitCreateBranchRequest
branch = "feature/backend/abc12345--def67890" branch = "feature/backend/abc12345--def67890"
svc = _service() svc = _service()
object.__setattr__(svc, "_resolve_base_branch", AsyncMock(return_value="master")) object.__setattr__(svc, "_resolve_base_branch", AsyncMock(return_value="master"))