Skip to content

Commit 1d07163

Browse files
test: warn instead of crash when whisper test hits 502 error
A 502 from the whisper endpoint means the upstream is unavailable, not that the code under test failed. Skip the test in that case so the run reports not-tested rather than a false negative.
1 parent b34e2e3 commit 1d07163

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

tests/test_wdoc.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -434,15 +434,23 @@ def test_query_tim_urban_testing_model():
434434
)
435435
def test_whisper_tim_urban():
436436
"""Test summarization of Tim Urban's video using whisper transcription."""
437-
out = wdoc(
438-
task="summarize",
439-
path="https://www.youtube.com/watch?v=arj7oStGLkU",
440-
model=f"openai/{WDOC_TEST_OPENAI_MODEL}",
441-
disable_llm_cache=True,
442-
# filetype="youtube",
443-
youtube_audio_backend="whisper",
444-
whisper_lang="en",
445-
)
437+
try:
438+
out = wdoc(
439+
task="summarize",
440+
path="https://www.youtube.com/watch?v=arj7oStGLkU",
441+
model=f"openai/{WDOC_TEST_OPENAI_MODEL}",
442+
disable_llm_cache=True,
443+
# filetype="youtube",
444+
youtube_audio_backend="whisper",
445+
whisper_lang="en",
446+
)
447+
except Exception as e:
448+
if "502" in str(e):
449+
pytest.skip(
450+
f"Whisper endpoint returned 502 (upstream unavailable), "
451+
f"treating as not-tested instead of failure: {e}"
452+
)
453+
raise
446454

447455

448456
@pytest.mark.api

0 commit comments

Comments
 (0)