pytest-cpp
Use pytest's runner to discover and execute C++ tests
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- 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.
- Low friction: pure Python wheel with only pytest as a runtime dependency.
- Actively maintained with recent commits and stable production status.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use this in commercial and proprietary projects with minimal restrictions beyond retaining the license notice.
last release 2024-09-18 (695 days) · last repo commit 2026-08-03 · 147 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 277,298 downloads/mo, #8,148 on PyPI
Alternatives
Verify before relying
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.- 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.
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 on this page. Verify before relying on it.
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
pytest-cpp on PyPI
Before you install
Low friction: pure Python wheel with only pytest as a runtime dependency. Actively maintained with recent commits and stable production status.
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.
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.
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 the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepytest |
| Maintenance | Actively maintained 695 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 277,298 / month, #8,148 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: C++Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Quality AssuranceTopic :: Software Development :: Testing |
Evidence: pytest_cpp-2.6.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “C++ test discovery pytest”
- pytest-cppA pytest plugin that discovers and runs C++ tests from Google Test,…
- rtestA Python test runner built in Rust that uses static AST analysis for…
- pytest-cmakeIntegrates Pytest with CMake build systems, enabling automatic…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also pytest-selenium · pytest-parallel · pytest-odoo · pytest-run-parallel · pytest-django · pytest-cov · pytest-incremental · pytest-logging · tdd-guard-pytest · pytest-slack