skillfed

pytest-monitor

Pytest plugin for analyzing resource usage.

pytest-monitor v1.6.6 113.7K downloads/30d#12,333 on PyPI180
Permissive license MIT DORMANT released

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-monitor

uv

uv add pytest-monitor

poetry

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 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

Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Testing

Tags

pytest resource monitoringtest memory profilingcpu usage tracking testspytest performance metricstest execution time measurementpytest resource consumptiontest performance history
performance-profilingtest-monitoringresource-tracking

More Testing packages

pluggy

Pluggy provides a plugin system that lets you…

permissive · top 100 on PyPI

pytest

pytest is a testing framework that lets you…

permissive · top 100 on PyPI

virtualenv

virtualenv creates isolated Python environments…

permissive · top 100 on PyPI

coverage

Coverage.py measures which lines of Python code…

permissive · top 1,000 on PyPI

pytest-asyncio

pytest-asyncio is a pytest plugin that enables…

permissive · top 1,000 on PyPI

pytest-json-ctrf

A pytest plugin that generates test reports in…

permissive · top 1,000 on PyPI

pytest-logging

A pytest plugin that configures Python logging…

permissive · top 15,000 on PyPI

memory-profiler

Profiles memory consumption line-by-line in…

permissive · top 5,000 on PyPI

pytest-regressions

Provides pytest fixtures for writing regression…

permissive · top 5,000 on PyPI

pytest-threadleak

A pytest plugin that detects when tests leak…

permissive · top 15,000 on PyPI

pytest-repeat

A pytest plugin that repeats test execution a…

copyleft · top 5,000 on PyPI

pytest-snapshot

A pytest plugin that enables snapshot…

permissive · top 5,000 on PyPI

pytest-replay

A pytest plugin that records test execution…

permissive · top 15,000 on PyPI

pytest-flakefinder

A pytest plugin that runs tests multiple times…

permissive · top 5,000 on PyPI

pytest-xml

A pytest plugin that generates XML output from…

unclear · top 15,000 on PyPI

pytest-find-dependencies

A pytest plugin that identifies dependencies…

permissive · top 5,000 on PyPI