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:
@@ -8,7 +8,7 @@ SQLAlchemy ``after_commit`` events and a recording bus stand-in.
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
import pytest
|
||||
@@ -99,7 +99,7 @@ async def _seed_agents_and_notification(
|
||||
metrics={},
|
||||
)
|
||||
db.add(r)
|
||||
recipient_ids.append(r.id)
|
||||
recipient_ids.append(cast("UUID", r.id))
|
||||
await db.flush()
|
||||
|
||||
notification = NotificationTable(
|
||||
@@ -113,7 +113,7 @@ async def _seed_agents_and_notification(
|
||||
)
|
||||
db.add(notification)
|
||||
await db.flush()
|
||||
return notification.id, notification
|
||||
return cast("UUID", notification.id), notification
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user