style(observe): 去冗余注解引号 + 整理 import(ruff UP037/I001)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
guke
2026-07-06 11:14:52 +08:00
parent 6c624c3cea
commit 9354588ba2
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -11,12 +11,12 @@ from app.core.config import settings
# 有界事件队列(懒创建,见 get_queue):首次取用时在运行中的 loop 里建,避免 import 期
# 无 loop 的边角问题;put_nowait/get_nowait 不需运行中的 loop → 可在无 loop 下测试。
_queue: "asyncio.Queue[dict] | None" = None
_queue: asyncio.Queue[dict] | None = None
# 队列满时的丢弃计数,worker 定期取出打日志。
_dropped = 0
def get_queue() -> "asyncio.Queue[dict]":
def get_queue() -> asyncio.Queue[dict]:
"""返回全局有界事件队列(懒创建)。测试可 monkeypatch 模块级 _queue 换成小队列。"""
global _queue
if _queue is None:
+1 -1
View File
@@ -7,8 +7,8 @@ from __future__ import annotations
import asyncio
from app.core.config import settings
from app.core import observe
from app.core.config import settings
def test_observe_configured_requires_switch_and_creds(monkeypatch):