pytest-monitor
Pytest plugin for analyzing resource usage.
What it is and what it does
pytest-monitor is a pytest plugin that runs automatically once installed and measures resource consumption for every test function. It collects memory usage (via memory-profiler), CPU usage (via psutil), and wall-clock execution time, storing all measurements in a local .pymon SQLite database alongside environment metadata (CPU count, RAM, Python version, system info, and SCM commit hash). This creates a historical record of test performance across runs and environments.
The plugin is designed for developers who need to track how test resource usage changes over time, compare behavior across different machines or configurations, or identify performance regressions. It requires Python 3.5+ and works only with pytest (not unittest). Results are stored locally by default, though optional backend services (monitor-server-api or pytest-monitor-backend) can be used for centralized storage and querying.
Use it for:
- Track memory and CPU trends in test suites across multiple commits to detect performance regressions early.
- Compare test resource usage between development, CI, and production environments to identify platform-specific issues.
- Identify memory leaks or CPU hotspots in tests by analyzing historical consumption patterns in the SQLite database.
- Establish performance baselines for test suites and alert when resource usage exceeds thresholds.
- Debug flaky tests by correlating resource spikes with test failures across different runs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that automatically measures and logs resource consumption (memory, CPU, execution time) for each test function, storing results in a local SQLite database for historical tracking and comparison.
Yes, if you need historical test performance tracking and your project is on a stable pytest version. The plugin is low-friction to install and requires no code changes—it activates automatically. However, the dormant maintenance status (last release June 2023) means compatibility with very recent pytest or Python versions is unverified; test this in a staging environment first if you're on cutting-edge tooling. No known security vulnerabilities.
Install
pytest-monitor on PyPI
pip
pip install pytest-monitoruv
uv add pytest-monitorpoetry
poetry add pytest-monitorInstalling pytest-monitor
Before you install
Low install friction with a pure-Python wheel distribution. Maintenance is dormant (last release 2023-06-25, 1146 days ago), though the repository remains active and the codebase is marked Production/Stable. Depends on pytest, psutil, and memory-profiler—all widely used, stable packages.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or distribution in commercial or proprietary projects.
Quickstart
pip install pytest-monitor
pytest your_tests/
# After the run, a .pymon SQLite database will be created in the current directory
# with resource consumption data for each test.
Requires Python 3.5+. The plugin does not work with unittest—only pytest test suites are supported.
Verify before relying
- Whether dormant maintenance status affects compatibility with recent pytest versions or Python 3.9+
- Performance overhead of continuous monitoring on large test suites
- Whether the SQLite backend scales adequately for projects with thousands of tests
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — pytest, requests, psutil, memory-profiler, wheel |
| Maintenance | dormant — 1,146 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 113,711/month — #12,333 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_monitor-1.6.6-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-loggingA pytest plugin that configures Python logging…
permissive · top 15,000 on PyPI
memory-profilerProfiles memory consumption line-by-line in…
permissive · top 5,000 on PyPI
pytest-regressionsProvides pytest fixtures for writing regression…
permissive · top 5,000 on PyPI
pytest-threadleakA pytest plugin that detects when tests leak…
permissive · top 15,000 on PyPI
pytest-repeatA pytest plugin that repeats test execution a…
copyleft · top 5,000 on PyPI
pytest-snapshotA pytest plugin that enables snapshot…
permissive · top 5,000 on PyPI
pytest-replayA pytest plugin that records test execution…
permissive · top 15,000 on PyPI
pytest-flakefinderA pytest plugin that runs tests multiple times…
permissive · top 5,000 on PyPI
pytest-xmlA pytest plugin that generates XML output from…
unclear · top 15,000 on PyPI
pytest-find-dependenciesA pytest plugin that identifies dependencies…
permissive · top 5,000 on PyPI