Skip to main content

Pytest plugin to initialize background process

Project description

pytest-bg-process

Pytest plugin to initialize background process.

The process will start once before all the tests using subprocess.Popen and will be killed once all the tests finished.

Installation

pip install pytest-bg-process

Configuration

From pytest configuration:

  • background-cmd:
    • Path to command to run at background
    • Default: None
  • background-cmd-env:
    • Environmental variable to path to command to run at background.
    • Has higher priority than background-cmd.
    • Default: None
  • background-pid:
    • Path to save PID data of the background process.
    • Default: background.pid
  • background-log:
    • Path to save log data of the background process.
    • Default: background.log

Example

Using background-cmd

[pytest]
background-cmd=redis-server
background-pid=redis.pid
background-log=redis.log

Using background-cmd-env

[pytest]
background-cmd-env=REDIS_CMD
background-pid=redis.pid
background-log=redis.log

then

REDIS_CMD=redis-server && pytest

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-bg-process-0.0.3.tar.gz (3.6 kB view hashes)

Uploaded source

Built Distribution

pytest_bg_process-0.0.3-py3-none-any.whl (4.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page