--- id: pytest-monitor version: "1.6.6" license: MIT license_treatment: permissive maintenance: dormant --- # pytest-monitor — Pytest plugin for analyzing resource usage. License: permissive · Maintenance: dormant · Downloads: 113.7K/mo ## 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 above — 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 pip install pytest-monitor uv add pytest-monitor poetry add pytest-monitor ## Installing 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_current - Install friction: low - Maintenance: dormant - Downloads: 113.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest resource monitoring, test memory profiling, cpu usage tracking tests, pytest performance metrics, test execution time measurement, pytest resource consumption, test performance history, performance-profiling, test-monitoring, resource-tracking [View on SkillFed](https://skillfed.io/packages/pytest-monitor) · [View on PyPI](https://pypi.org/project/pytest-monitor/)