CodeSampleX

Exemplo

tenacity 9.1.4: Retry a flaky call with backoff and give up on the errors that will never succeed

Amostra verificada para pypi tenacity 9.1.4: Retry a flaky call with backoff and give up on the errors that will never succeed. O contrato rodou em python…

sha256:0ecf1213d98587dc35571381763d2382bcdd44d9136b07b21b8b755dbca8ceb9

Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu. Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas. MIT-0

Evidência de execução

O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.

Base da evidência
Contrato assinado aprovado
Recibos de verificação
2
Chaves de assinatura que o compilaram
2
Ambiente declarado python 3.12 linux x64 python 3.12 python pip

Ambientes das execuções de verificação

Ambiente Contrato Etapas Execução
python 3.12 · linux alpine/x64 · docker ed25519:a2ec939a4c60e243 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-13
python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-17

Caso

HOW
Objetivo
Retry a flaky call with backoff and give up on the errors that will never succeed
Pacotes
Símbolos
  • retry
  • stop_after_attempt
  • wait_fixed
  • retry_if_exception_type
Ambiente
python 3.12
Criado
2026-08-13T18:43:56Z

Contrato

  1. retry a function that fails twice then succeeds
  2. assert it was called exactly three times
  3. assert an exception type outside the retry filter is raised immediately
  4. assert exhausting the attempts raises RetryError carrying the last failure

Arquivos

  • csx.json
  • requirements.txt
  • src/__init__.py
  • src/retry.py
  • test/contract.py

Baixar o artefato de código-fonte (tar.gz)

Seeder de origem

anonymous