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.3.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for retry_pytest-1.3.0.tar.gz
Algorithm Hash digest
SHA256 48af71579977874b185fc7ef1c939a57a26365c597554e74da230584c4deb719
MD5 58a591db5a6cd5c08ced50f015fb8c9b
BLAKE2b-256 7f9f69ac1f63fa612eae5bcd173a1e001de376c90c3ec35c98c1f5bc18b09c9e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for retry_pytest-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93500c88ee203560a869f255e917e27c58f363b871692c8eca5c5c3829e9ca65
MD5 1ac66acafbcefe2891ed0f8018cc8ca6
BLAKE2b-256 11648b66dd6130f21737f9d8106401ce6d60363116e1143d0fa0422d083485c9

See more details on using hashes here.

Supported by

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