mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
[fix] resolve 16 mypy errors across 9 test files (make quality gate)
type-clean the test files so make quality (mypy roboco/ tests/) is green:
- Any-typed locals for the two TypeError-asserting scoping tests (bypass
the required-arg check without getattr/ruff B009)
- Any-typed view for the shutdown-drain _drain_bg_tasks override (bypass
mypy method-assign without setattr/ruff B010)
- cast("uuid.UUID", ...) / cast("UUID", ...) for SQLAlchemy UUID[Any]
returns (TC006-quoted), config=None for AgentInstance stubs, None-narrowed
await_args, Iterator return on a yielding fixture, UUID annotation on the
_task helper. No type:ignore / noqa.
This commit is contained in:
@@ -71,7 +71,7 @@ async def _seed_project(db: AsyncSession, slug: str) -> ProjectTable:
|
||||
return project
|
||||
|
||||
|
||||
def _task(project_id, *, branch: str, status: TaskStatus) -> TaskTable:
|
||||
def _task(project_id: UUID, *, branch: str, status: TaskStatus) -> TaskTable:
|
||||
return TaskTable(
|
||||
id=uuid4(),
|
||||
title=f"task {branch}",
|
||||
@@ -102,8 +102,10 @@ async def test_branch_owned_only_by_its_own_project(db_session: AsyncSession) ->
|
||||
proj_b = await _seed_project(db_session, "gca-collide-b")
|
||||
db_session.add_all(
|
||||
[
|
||||
_task(proj_a.id, branch=_BRANCH, status=TaskStatus.IN_PROGRESS),
|
||||
_task(proj_b.id, branch=_BRANCH, status=TaskStatus.COMPLETED),
|
||||
_task(
|
||||
cast("UUID", proj_a.id), branch=_BRANCH, status=TaskStatus.IN_PROGRESS
|
||||
),
|
||||
_task(cast("UUID", proj_b.id), branch=_BRANCH, status=TaskStatus.COMPLETED),
|
||||
]
|
||||
)
|
||||
await db_session.flush()
|
||||
|
||||
Reference in New Issue
Block a user