Skip to main content

retry_pytest

Project description

import operator
from retry_pytest.retry import Retry

with Retry() as r:
    r.check(operator.sub, 4, 2).equal(2)
import operator
from retry_pytest.retry import Retry

with Retry(ZeroDivisionError, title='custom allure step title for skip ZeroDivisionError', timeout=10, poll_frequency=2) as r:
    r.check(operator.truediv, 4, 0).equal(2)
import operator
from retry_pytest.retry import Retry

with Retry() as r:
    r.check(operator.sub, 4, 2).equal(1)
    r.on_timeout(print, 'wtf')
import operator
from retry_pytest.retry import Retry

with Retry() as r:
    r.check(operator.sub, 4, 2).equal(2)
    r.check(operator.add, 2, 2).equal(4)
from retry_pytest.retry import Retry

def get_result_as_list_of_dicts():
    return [{'key1': 'data1', 'key2': 'data2'}]
 
with Retry() as r:
    r.check(get_result_as_list_of_dicts).get(0).get('key1').equal('data1')
from retry_pytest.retry import Retry

def get_result_as_list():
    return [1,2,3]
 
with Retry() as r:
    r.check(get_result_as_list).get(0).equal(1)
from retry_pytest.retry import Retry

def get_result_as_dict():
    return {'key1': 'data1', 'key2': 'data2'}
 
with Retry() as r:
    r.check(get_result_as_dict).get('key1').equal('data1')
from retry_pytest.retry import Retry

def get_result_as_list_of_dicts():
    return [{'key1': 'data1', 'key2': 'data2'}]
 
with Retry() as r:
    r.check(get_result_as_list_of_dicts).get(0).get('key1').equal('data1')
    r.check(get_result_as_list_of_dicts).get(0).get('key2').equal('data2')
 
print(r.commands[-2].result)
print(r.last_command.result)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retry_pytest-1.2.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

retry_pytest-1.2.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file retry_pytest-1.2.0.tar.gz.

File metadata

  • Download URL: retry_pytest-1.2.0.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for retry_pytest-1.2.0.tar.gz
Algorithm Hash digest
SHA256 1ea49dc7847a62a7594205f5872e2549834623b7b019129defad1ff864fe9278
MD5 5fa4a8919c6ea696c48b55c8011e13b5
BLAKE2b-256 8646e4d6b3baf684ae0598bead87b4d2239e4b9f1e6f2224d77e0ca93a77e3af

See more details on using hashes here.

File details

Details for the file retry_pytest-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: retry_pytest-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for retry_pytest-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c984ed9f2a89c437b8f5a39700964968af551e4d40efa2161578eed3466249a
MD5 b584d97b48e9d14d132e29119da1ab62
BLAKE2b-256 a11510e575f7b388d389e06195d1b13faa8ff028609bbc306db407debafd6677

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page