--- id: pytest-cpp version: "2.6.0" license: MIT license_treatment: permissive maintenance: active --- # pytest-cpp — Use pytest's runner to discover and execute C++ tests License: permissive · Maintenance: active · Downloads: 277.3K/mo ## What it is and what it does pytest-cpp is a pytest plugin that bridges Python's test runner with C++ test frameworks, allowing you to discover and execute C++ tests using pytest's command-line interface and reporting tools. It automatically detects test binaries built with Google Test, Boost.Test, or Catch2, and integrates them into your pytest workflow. The plugin lets you run mixed Python and C++ test suites with a single pytest command, apply pytest's standard filtering (like -k for keyword matching), generate unified JUnit XML reports, and parallelize C++ test execution using pytest-xdist. It supports configuration options for specifying which files to test, passing arguments to C++ test binaries, and wrapping test execution with tools like valgrind or emulators for cross-compilation scenarios. Use it for: - Run all tests in a multi-language project (Python and C++) with one pytest command. - Generate a single JUnit XML report combining results from both Python and C++ test suites. - Parallelize C++ test execution across multiple cores using pytest-xdist. - Filter and select which C++ tests to run using pytest's standard -k keyword matching. - Wrap C++ test execution with memory checkers (valgrind) or emulators (qemu) for testing in non-native environments. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that discovers and runs C++ tests from Google Test, Boost.Test, and Catch2 frameworks using pytest's test runner and reporting infrastructure. Yes. If you maintain a multi-language project with C++ and Python tests, this plugin eliminates the need for separate test runners and reporting pipelines. It has low install friction, active maintenance, no known vulnerabilities, and a permissive MIT license. The only prerequisite is having compiled C++ test binaries; the plugin does not compile code itself. ## Install pip install pytest-cpp uv add pytest-cpp poetry add pytest-cpp ## Installing pytest-cpp Before you install: Low friction: pure Python wheel with only pytest as a runtime dependency. Actively maintained with recent commits and stable production status. License in practice: MIT license is permissive; you can use this in commercial and proprietary projects with minimal restrictions beyond retaining the license notice. Quickstart: pip install pytest-cpp Then run: pytest The plugin automatically detects and executes C++ test binaries (Google Test, Boost.Test, Catch2) in your project directory. Requires compiled C++ test executables matching the naming pattern test_* or *_test to be present in the project; the plugin does not compile C++ code itself. Verify before relying: - Whether the plugin works with C++ test frameworks beyond Google Test, Boost.Test, and Catch2. - Performance characteristics when running large numbers of C++ tests in parallel with pytest-xdist. - Compatibility with recent versions of Google Test, Boost.Test, and Catch2 frameworks. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 277.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest C++ test runner, C++ test discovery pytest, Google Test pytest integration, Catch2 pytest plugin, multi-language test execution, C++ Boost.Test pytest, unified test reporting C++, c++-testing, multi-language-projects, test-integration [View on SkillFed](https://skillfed.io/packages/pytest-cpp) · [View on PyPI](https://pypi.org/project/pytest-cpp/)