--- id: pytest-xprocess version: "1.0.2" license: MIT license_treatment: permissive maintenance: active --- # pytest-xprocess — A pytest plugin for managing processes across test runs. License: permissive · Maintenance: active · Downloads: 307.6K/mo ## What it is and what it does pytest-xprocess is a pytest plugin that handles the lifecycle of external processes during test execution. Rather than starting and stopping a service (like a database, cache, or API server) for each test, it manages long-lived processes that can be reused across multiple tests, reducing test overhead and improving speed. The plugin works by maintaining process state across test runs and providing fixtures to interact with these processes. It depends on pytest for the test framework integration and psutil for cross-platform process management. It supports Python 3.8 through 3.11 and is classified as Beta stability, indicating it is mature but may still have minor API changes. Use it for: - Start a database server once and reuse it across all tests instead of spinning up a new instance per test. - Manage a mock API or HTTP service that multiple test cases need to communicate with. - Control background worker processes or message queues during integration testing. - Reduce test suite runtime by avoiding repeated startup costs of external services. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. pytest-xprocess manages external processes (like servers or services) across pytest test runs, allowing tests to start, reuse, and control long-lived processes without restarting them for each test. Yes, if your test suite relies on external processes. The plugin is actively maintained, has low install friction, carries no security vulnerabilities, and uses a permissive MIT license. It is well-suited for integration tests that need to manage services across multiple test runs. ## Install pip install pytest-xprocess uv add pytest-xprocess poetry add pytest-xprocess ## Installing pytest-xprocess Before you install: Low friction install with only pytest and psutil as runtime dependencies. The package is actively maintained with a recent commit history and has been stable since its early releases. License in practice: MIT license is permissive, allowing use in commercial and open-source projects with minimal restrictions. Quickstart: pip install pytest-xprocess import pytest from pytest_xprocess import XProcess def test_with_process(xprocess): # xprocess manages the external process lifecycle xprocess.ensure("my_service", lambda: ...) Verify before relying: - Whether the plugin supports process cleanup and signal handling across different operating systems. - Performance characteristics when managing many concurrent external processes. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 307.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest external process management, manage server processes in tests, pytest long-running services, reuse processes across test runs, pytest process fixtures, control external processes pytest, pytest-plugin, process-management, integration-testing [View on SkillFed](https://skillfed.io/packages/pytest-xprocess) · [View on PyPI](https://pypi.org/project/pytest-xprocess/)