VOOZH about

URL: https://pypi.org/project/pytest-forked/

⇱ pytest-forked Β· PyPI


Skip to main content

pytest-forked 1.6.0

pip install pytest-forked

Latest release

Released:

run tests in isolated forked subprocesses

Navigation

Unverified details

These details have not been verified by PyPI
Project links
Meta
  • License: MIT License (MIT)
  • Author: pytest-dev
  • Requires: Python >=3.7

Project description

This plugin does not work on Windows because there’s no fork support.

  • --forked: run each test in a forked subprocess to survive SEGFAULTS or otherwise dying processes.

πŸ‘ python
πŸ‘ version
πŸ‘ ci
πŸ‘ pre-commit
πŸ‘ black

Installation

Install the plugin with:

pip install pytest-forked

or use the package in develope/in-place mode with a checkout of the pytest-forked repository

pip install -e .

Usage examples

If you have tests involving C or C++ libraries you might have to deal with tests crashing the process. For this case you may use the boxing options:

pytest --forked

which will run each test in a subprocess and will report if a test crashed the process. You can also combine this option with running multiple processes via pytest-xdist to speed up the test run and use your CPU cores:

pytest -n3 --forked

this would run 3 testing subprocesses in parallel which each create new forked subprocesses for each test.

You can also fork for individual tests:

@pytest.mark.forked
def test_with_leaky_state():
 run_some_monkey_patches()

This test will be unconditionally boxed, regardless of CLI flag.

Project details

Unverified details

These details have not been verified by PyPI
Project links
Meta
  • License: MIT License (MIT)
  • Author: pytest-dev
  • Requires: Python >=3.7

Download files

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

Source Distribution

pytest-forked-1.6.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

Filter files by name, interpreter, ABI, and platform.

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

Copy a direct link to the current filters

pytest_forked-1.6.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file pytest-forked-1.6.0.tar.gz.

File metadata

  • Download URL: pytest-forked-1.6.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pytest-forked-1.6.0.tar.gz
Algorithm Hash digest
SHA256 4dafd46a9a600f65d822b8f605133ecf5b3e1941ebb3588e943b4e3eb71a5a3f
MD5 c2c026fc5bc4ad54649d7f85e36a62ec
BLAKE2b-256 8cc993ad2ba2413057ee694884b88cf7467a46c50c438977720aeac26e73fdb7

See more details on using hashes here.

File details

Details for the file pytest_forked-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_forked-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pytest_forked-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 810958f66a91afb1a1e2ae83089d8dc1cd2437ac96b12963042fbb9fb4d16af0
MD5 50167f2405829fb88cd79e20fcf4049b
BLAKE2b-256 f4af9c0bda43e486a3c9bf1e0f876d0f241bc3f229d7d65d09331a0868db9629

See more details on using hashes here.

Supported by

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