Download fixtures/pattern_lab/tests/test_retries.py from tailot/codex-python: direct link, hf CLI and curl.
- Browser
- Download file 424 Bytes
-
https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/tests/test_retries.py
- Command line
-
hf download hf://datasets/tailot/codex-python/fixtures/pattern_lab/tests/test_retries.py
-
curl -L -o test_retries.py https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/tests/test_retries.py
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()) == "" | |