Exemplo
Retry a flaky call with backoff and give up on the errors that will never succeed
sha256:0ecf1213d98587dc35571381763d2382bcdd44d9136b07b21b8b755dbca8ceb9
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Retry a flaky call with backoff and give up on the errors that will never succeed HOW
- Pacotes
- tenacity 9.1.4
- Ambiente
- python 3.12
- Criado
- 2026-08-13T18:43:56Z
Contrato
- retry a function that fails twice then succeeds
- assert it was called exactly three times
- assert an exception type outside the retry filter is raised immediately
- assert exhausting the attempts raises RetryError carrying the last failure
Arquivos
- csx.json
- requirements.txt
- src/__init__.py
- src/retry.py
- test/contract.py
Seeder de origem
Recibos de verificação
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-13 · ed25519:a2ec939a4c60e243
- · CONTAINER_RUN · compile:SKIPPED · contract:FAIL · load:SKIPPED · resolve:PASS · python@1 · 2026-08-13 · ed25519:7da3f610facce8bf