Skip to main content
Help us improve Python packaging – donate today!

run tests in isolated forked subprocesses

Project Description

Warning

this is a extraction of the xdist –forked module, future maintenance beyond the bare minimum is not plannend until a new maintainer is found

  • --forked: (not available on Windows) run each test in a forked subprocess to survive SEGFAULTS or otherwise dying processes

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:

py.test --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:

py.test -n3 --forked

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

Release history Release notifications

This version
History Node

0.2

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pytest_forked-0.2-py2.py3-none-any.whl (6.1 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Aug 4, 2017
pytest-forked-0.2.tar.gz (9.6 kB) Copy SHA256 hash SHA256 Source None Aug 4, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page