test: HTTP-тесты разбора отметок не требуют PostgreSQL

This commit is contained in:
Ivan Gerasimov 2026-09-27 16:25:02 +03:00
commit 3f5f57877a

View file

@ -160,7 +160,16 @@ def lesson(monkeypatch):
async def no_coach(_metrics): async def no_coach(_metrics):
return NoCoaching() return NoCoaching()
async def audit_in_memory(*_args, **_kwargs):
return None
async def no_database():
yield None
# Живое занятие в памяти: чтение отчёта не должно ходить в PostgreSQL.
monkeypatch.setattr(finish_module, "coach", no_coach) monkeypatch.setattr(finish_module, "coach", no_coach)
monkeypatch.setattr(sessions, "audit_required", audit_in_memory)
monkeypatch.setitem(app.dependency_overrides, sessions.optional_session, no_database)
store = MemorySessionStore() store = MemorySessionStore()
monkeypatch.setattr(hub, "store", store) monkeypatch.setattr(hub, "store", store)
state = dds_exercise_early_finish() state = dds_exercise_early_finish()