test(tts): accept stream kwarg in the 4 stale xAI fake_post mocks (#73619)

_generate_xai_tts passes stream=True to requests.post since the TTS
speaker pipeline moved to the streaming core. Four fake_post mocks in
test_tts_xai_speech_tags.py still had the pre-streaming signature and
raised TypeError: unexpected keyword argument 'stream'. The other 20+
mocks in the same file already accept stream=False; this aligns the
stragglers.

Fixes the 4 failures in Python tests slice 5/8 on main.
This commit is contained in:
kshitij 2026-07-29 01:19:23 +05:30 committed by GitHub
parent 89490ae373
commit 64469bd2c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -143,7 +143,7 @@ def test_generate_xai_tts_uses_oauth_pinned_base_url(tmp_path, monkeypatch):
def raise_for_status(self):
pass
def fake_post(url, headers, json, timeout):
def fake_post(url, headers, json, timeout, stream=False):
captured["url"] = url
captured["headers"] = headers
return FakeResponse()
@ -590,7 +590,7 @@ def test_generate_xai_tts_omits_text_normalization_by_default(tmp_path, monkeypa
fake_response.content = b"mp3"
fake_response.raise_for_status.return_value = None
def fake_post(url, headers, json, timeout):
def fake_post(url, headers, json, timeout, stream=False):
captured["json"] = json
return fake_response
@ -614,7 +614,7 @@ def test_generate_xai_tts_sends_text_normalization_when_enabled(tmp_path, monkey
fake_response.content = b"mp3"
fake_response.raise_for_status.return_value = None
def fake_post(url, headers, json, timeout):
def fake_post(url, headers, json, timeout, stream=False):
captured["json"] = json
return fake_response
@ -640,7 +640,7 @@ def test_generate_xai_tts_omits_text_normalization_when_explicit_false(
fake_response.content = b"mp3"
fake_response.raise_for_status.return_value = None
def fake_post(url, headers, json, timeout):
def fake_post(url, headers, json, timeout, stream=False):
captured["json"] = json
return fake_response