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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pytest-bg-process-0.0.3.tar.gz.

File metadata

  • Download URL: pytest-bg-process-0.0.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytest-bg-process-0.0.3.tar.gz
Algorithm Hash digest
SHA256 de68955426b6f37ad5b49a20a0f3c906a5b5e275fa399caecb5e158f04f4ab8a
MD5 b0264d204dc395c6b2e6d20d057ccf82
BLAKE2b-256 dfc0fe32a563f53f7e8a1d4f0d8d7b994a8e30878fe0c1e1fa60e36489397898

See more details on using hashes here.

File details

Details for the file pytest_bg_process-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pytest_bg_process-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytest_bg_process-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fcbdedf5ef29a4f1ff4c8d48b887b3e3ec1da2b3bfc4490768e32fc88238ad73
MD5 048881297651ee8503cb2307da7851bc
BLAKE2b-256 2f43ef33a8327e24f66da94e2971992dd02c4f7eec53b581dacda24036b33d0b

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