CodeSampleX

Beispiel

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

Verifiziertes Beispiel für pypi tenacity 9.1.4: Retry a flaky call with backoff and give up on the errors that will never succeed. Der Vertrag lief auf…

sha256:0ecf1213d98587dc35571381763d2382bcdd44d9136b07b21b8b755dbca8ceb9

Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen. Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen. MIT-0

Ausführungsbelege

Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.

Beleggrundlage
Signierter Vertrag bestanden
Verifizierungsbelege
2
Signaturschlüssel, die es gebaut haben
2
Deklarierte Umgebung python 3.12 linux x64 python 3.12 python pip

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
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

Fall

HOW
Ziel
Retry a flaky call with backoff and give up on the errors that will never succeed
Pakete
Symbole
  • retry
  • stop_after_attempt
  • wait_fixed
  • retry_if_exception_type
Umgebung
python 3.12
Erstellt
2026-08-13T18:43:56Z

Contract

  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

Dateien

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

Quellartefakt herunterladen (tar.gz)

Ursprungs-Seeder

anonymous