Skip to main content

A hack to explicitly set up and tear down fixtures.

Project description

A hack to explicitly set up and tear down fixtures.

This terrible plugin allows you to set up and tear down fixtures within the test function itself. This is useful (necessary!) for using Hypothesis inside py.test, as hypothesis will call the test function multiple times, without setting up or tearing down fixture state as is normally the case.

Installation:

pip install pytest-subtesthack

…though the plugin is 32 lines of code, consider vendoring it.

See test_example.py for usage.

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-subtesthack-0.2.0.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file pytest-subtesthack-0.2.0.tar.gz.

File metadata

  • Download URL: pytest-subtesthack-0.2.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.8

File hashes

Hashes for pytest-subtesthack-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ebb504203c9c01fdd379d2afa747687dcb7b1ed1be1fc0c3f539b2de81276200
MD5 3c4adc84a1f185d6ed6248d984107880
BLAKE2b-256 ddf300d45229d7dbd7ec42c30cd3208842200306a7737050f0160eec34da72cf

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