{"categories":[{"label":"Debuggers","url":"https://skillfed.io/packages/category/software-development-debuggers"}],"enrichment":{"capability":"A pytest plugin that integrates memray memory profiling into test runs, tracking memory allocations per test and reporting detailed allocation breakdowns.","skillfed_tags":["memory-profiling","pytest-plugin","performance-testing"],"use_cases":["Catch memory leaks in unit tests by setting per-test memory limits and failing tests that exceed them.","Identify which functions allocate the most memory during test execution for optimization.","Track memory usage trends across test runs and fail if a test's memory footprint grows unexpectedly.","Debug memory issues in CI/CD pipelines by generating detailed allocation reports for each test.","Profile Python allocator behavior separately from native allocations using `--trace-python-allocators`."],"what_it_does":"pytest-memray is a pytest plugin that wraps memray's memory profiling capabilities for test-driven memory debugging. It activates via the `--memray` CLI flag and tracks heap allocations throughout each test, then generates a summary report showing total memory used, allocation counts, and the call stacks responsible for the largest allocations. You can set per-test memory limits using the `limit_memory` marker and fail tests that exceed them; the plugin also supports tracking memory growth across runs with `--fail-on-increase` to catch regressions.\n\nThe plugin is designed for developers who need to catch memory leaks or excessive allocations in their test suite without manually instrumenting code. It outputs allocation histograms, identifies the functions and line numbers responsible for the biggest memory consumers, and can optionally show native C-level frames for deeper profiling. Configuration is available both via CLI flags and pytest INI settings.","worth_installing":"Yes. The plugin is actively maintained, has low install friction, carries no security vulnerabilities, and solves a real problem\u2014memory profiling in tests\u2014that is otherwise tedious to set up. It's well-suited for projects concerned with memory efficiency or regression detection. The Apache-2.0 license is permissive and poses no barrier to adoption."},"id":"pytest-memray","links":{"html":"https://skillfed.io/packages/pytest-memray","md":"https://skillfed.io/packages/pytest-memray.md","pypi":"https://pypi.org/project/pytest-memray/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-08-07","license_spdx":"Apache-2.0","license_treatment":"permissive","name":"pytest-memray","python_support":"supports_current","summary":"A simple plugin to use with pytest"},"popularity":{"monthly_downloads":2893206,"position":2836,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.10.0"}
