codex-python / fixtures /pattern_lab /tests /test_retries.py
tailot's picture
Upload folder using huggingface_hub
db2c7db verified
Raw History Blame Contribute Delete
424 Bytes
"""Tests for the two retry shapes in src.retries."""
from src.retries import call_or_none, call_or_note
class _BrokenSource:
def read(self):
raise ValueError("the source is closed")
def test_call_or_note_reports_a_broken_source() -> None:
assert call_or_note(_BrokenSource()) == "no source"
def test_call_or_none_falls_back_when_reading_fails() -> None:
assert call_or_none(_BrokenSource()) == ""