pytest-profiling
Profiling plugin for py.test
Decision gist · record as of 2026-08-14
Yes, if you need to profile test performance. The plugin is stable, has low install friction, carries no license restrictions, and integrates directly into pytest with minimal configuration. The aging maintenance status (last release 623 days ago) is a minor concern but not a blocker—the package is feature-complete and no known vulnerabilities exist. Install it when you need to understand where CPU time goes during testing.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Graphviz (dot command) must be installed on the system to generate SVG output with --profile-svg.
- Low friction install with only three runtime dependencies (six, pytest, gprof2dot).
- Maintenance status is aging—last release was 623 days ago—but the repository remains active and the package supports current Python versions (3.6–3.12).
License · maintenance · safety
MIT license (permissive) — MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
last release 2024-11-29 (623 days) · last repo commit 2026-01-28 · 598 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,867,549 downloads/mo, #3,476 on PyPI
Alternatives
Verify before relying
pip install pytest-profiling
# In conftest.py or test file:
pytest_plugins = ['pytest_profiling']
# Run tests with profiling:
# pytest tests/ --profile
# pytest tests/ --profile-svg- Whether pstats files are automatically cleaned up or retained indefinitely in the prof/ directory.
- Performance overhead of profiling on test suites with thousands of tests.
- Compatibility with pytest plugins that also instrument test execution.
What it is and what it does
pytest-profiling is a pytest plugin that automatically profiles test execution using Python's built-in cProfile module and outputs results as human-readable tables or SVG call graphs. When you run pytest with the --profile flag, the plugin captures CPU time and call counts for every function invoked during each test, then aggregates results into a combined.prof file alongside individual per-test profile files stored in a prof/ directory. The --profile-svg option generates visual heat graphs using gprof2dot and Graphviz, making it easy to spot performance bottlenecks at a glance.
The plugin integrates seamlessly into pytest's test discovery and execution flow, requiring only a one-line fixture registration. It depends on six, pytest, and gprof2dot as runtime dependencies. The package is stable (Production/Stable status) and supports Python 3.6 through 3.12, though maintenance is aging—the last release was in late 2024 and the repository shows no recent activity. It is well-suited for developers who need to identify slow tests or understand where CPU time is spent during test runs.
Use it for
- Identify which tests or test fixtures consume the most CPU time in a large test suite.
- Generate SVG flame graphs to visualize function call hierarchies and spot performance regressions.
- Analyze pstats files offline using Python's pstats module for deeper investigation of test performance.
- Detect unexpected slowdowns in test execution after code changes by comparing prof files.
- Profile integration tests that exercise multiple layers of an application to find bottlenecks.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to profile test performance.
The plugin is stable, has low install friction, carries no license restrictions, and integrates directly into pytest with minimal configuration. The aging maintenance status (last release 623 days ago) is a minor concern but not a blocker—the package is feature-complete and no known vulnerabilities exist. Install it when you need to understand where CPU time goes during testing.
Install
pytest-profiling on PyPI
Before you install
Low friction install with only three runtime dependencies (six, pytest, gprof2dot). Maintenance status is aging—last release was 623 days ago—but the repository remains active and the package supports current Python versions (3.6–3.12).
Graphviz (dot command) must be installed on the system to generate SVG output with --profile-svg.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install pytest-profiling
# In conftest.py or test file:
pytest_plugins = ['pytest_profiling']
# Run tests with profiling:
# pytest tests/ --profile
# pytest tests/ --profile-svg
Verify before relying
- Whether pstats files are automatically cleaned up or retained indefinitely in the prof/ directory.
- Performance overhead of profiling on test suites with thousands of tests.
- Compatibility with pytest plugins that also instrument test execution.
Package facts
| License | MIT license permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagessixpytestgprof2dot |
| Maintenance | Aging 623 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,867,549 / month, #3,476 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/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: POSIXProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: TestingTopic :: Utilities |
Evidence: pytest_profiling-1.8.1-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 › “pytest profiling plugin”
- pytest-profilingPytest plugin that profiles test execution using cProfile and…
- pytest-benchmarkA pytest fixture that benchmarks Python functions by running them in…
- pytest-memrayA pytest plugin that integrates memray memory profiling into test…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
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.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
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.
See also flameprof · gprof2dot · pyprof2calltree · django-cprofile-middleware · fastapi-profiler · pytest-shutil · pytest-replay · line-profiler · pytest-fixture-config · pytest-logging