[CI] Re-use whisper_client for all tests (#30148)

Signed-off-by: NickLucche <nlucches@redhat.com>
This commit is contained in:
Nicolò Lucchesi 2025-12-05 20:47:37 +01:00 committed by GitHub
parent 3633035a3f
commit e23ca3a0e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,13 +32,9 @@ async def whisper_client(server):
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_basic_audio(mary_had_lamb): async def test_basic_audio(whisper_client, mary_had_lamb):
server_args = ["--enforce-eager"]
# Based on https://github.com/openai/openai-cookbook/blob/main/examples/Whisper_prompting_guide.ipynb. # Based on https://github.com/openai/openai-cookbook/blob/main/examples/Whisper_prompting_guide.ipynb.
with RemoteOpenAIServer(MODEL_NAME, server_args) as remote_server: transcription = await whisper_client.audio.transcriptions.create(
client = remote_server.get_async_client()
transcription = await client.audio.transcriptions.create(
model=MODEL_NAME, model=MODEL_NAME,
file=mary_had_lamb, file=mary_had_lamb,
language="en", language="en",