refactor: telegram modules and tighten linting (#111)

This commit is contained in:
banteg
2026-01-13 05:14:26 +04:00
committed by GitHub
parent f060d3b59c
commit c1205cd5a8
63 changed files with 3257 additions and 3073 deletions
+3 -4
View File
@@ -7,7 +7,6 @@ from takopi.model import (
Action,
ActionEvent,
CompletedEvent,
EngineId,
ResumeToken,
StartedEvent,
TakopiEvent,
@@ -15,7 +14,7 @@ from takopi.model import (
from takopi.runners.mock import Emit, Return, ScriptRunner, Wait
from tests.factories import action_started
CODEX_ENGINE = EngineId("codex")
CODEX_ENGINE = "codex"
@pytest.mark.anyio
@@ -84,7 +83,7 @@ async def test_runner_releases_lock_when_consumer_closes() -> None:
gate = anyio.Event()
runner = ScriptRunner([Wait(gate)], engine=CODEX_ENGINE, resume_value="sid")
gen = cast(AsyncGenerator[TakopiEvent, None], runner.run("hello", None))
gen = cast(AsyncGenerator[TakopiEvent], runner.run("hello", None))
try:
while True:
evt = await anext(gen)
@@ -94,7 +93,7 @@ async def test_runner_releases_lock_when_consumer_closes() -> None:
await gen.aclose()
gen2 = cast(
AsyncGenerator[TakopiEvent, None],
AsyncGenerator[TakopiEvent],
runner.run("again", ResumeToken(engine=CODEX_ENGINE, value="sid")),
)
try: