Skip to main content

A 'defer' fixture for pytest

Project description

pytest_defer - A "defer" fixture for pytest

def test_example(defer):
    # All functions appended to defer will execute at test end in reverse order
    instance1 = spin_instance()
    defer.append(delete_instance, instance1)  # called second
    instance2 = spin_instance()
    defer.append(delete_instance, instance2, timeout=30)  # called first

    # Test code using instance1 & instance2
    ...

Development

Me (@tebeka) is playing around with uv for this project.

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

pytest_defer-0.2.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

pytest_defer-0.2.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file pytest_defer-0.2.1.tar.gz.

File metadata

  • Download URL: pytest_defer-0.2.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.1

File hashes

Hashes for pytest_defer-0.2.1.tar.gz
Algorithm Hash digest
SHA256 929410399b9cdd67081b8fc930cfe3c883315140417098b7b57a8394cde8c1ce
MD5 a2227de6ac3f3dd27619015beccb9c5b
BLAKE2b-256 5af7bc26befedff3c76fe1c1386139542528050d9b29dc0205e482f94a09b642

See more details on using hashes here.

File details

Details for the file pytest_defer-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_defer-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f34099a20eb96ce8b2f9e13fb958d6faf8babeceb4c5f5e95831dfb09efb0377
MD5 1125fad2fb253c4f5fe47403d2b9f28b
BLAKE2b-256 950be3264820559a8e26e27794d87f683ed0772d002be6572f681124880fdd1a

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