Skip to content

test(gateway): stop TTS state leaking into later tests - #268

Merged
OmarB97 merged 1 commit into
mainfrom
fix/tts-test-state-cleanup-20260712
Jul 12, 2026
Merged

test(gateway): stop TTS state leaking into later tests#268
OmarB97 merged 1 commit into
mainfrom
fix/tts-test-state-cleanup-20260712

Conversation

@OmarB97

@OmarB97 OmarB97 commented Jul 12, 2026

Copy link
Copy Markdown
Owner

What changed

  • Seed HERMES_VOICE_TTS=0 with pytest monkeypatch before exercising the runtime TTS toggle.
  • This makes pytest own and remove the variable at teardown instead of leaving TTS enabled for later tests.

Root cause

monkeypatch.delenv(..., raising=False) registers no undo when the key starts absent. The tested voice.toggle handler then sets HERMES_VOICE_TTS=1, which leaked through the rest of tests/test_tui_gateway_server.py. A later fake completion containing partial answer complete consequently generated an MP3 and launched /usr/bin/afplay on the developer machine.

Verification

  • scripts/run_tests.sh tests/test_tui_gateway_server.py -q -k "voice_toggle_tts_branch_also_carries_record_key or session_activate_returns_inflight_stream_before_completion" — 2 passed.
  • macOS unified audio log for that run — 0 afplay audio events.

Scope

One test-only environment setup line plus the explanatory comment.

@OmarB97
OmarB97 merged commit e175447 into main Jul 12, 2026
21 of 31 checks passed
OmarB97 added a commit that referenced this pull request Jul 20, 2026
Co-authored-by: Omar Baradei <omar@kostudios.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant