Metadata-Version: 2.4
Name: pytest-perf
Version: 0.13.1
Summary: Run performance tests against the mainline code.
Home-page: https://github.com/jaraco/pytest-perf
Author: Jason R. Coombs
Author-email: jaraco@jaraco.com
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.7
License-File: LICENSE
Requires-Dist: pip-run>=8.5
Requires-Dist: tempora>=4.1
Requires-Dist: jaraco.functools
Requires-Dist: more_itertools
Requires-Dist: jaraco.context
Requires-Dist: packaging
Provides-Extra: testing
Requires-Dist: pytest>=6; extra == "testing"
Requires-Dist: pytest-checkdocs>=2.4; extra == "testing"
Requires-Dist: pytest-black>=0.3.7; platform_python_implementation != "PyPy" and extra == "testing"
Requires-Dist: pytest-cov; extra == "testing"
Requires-Dist: pytest-mypy>=0.9.1; platform_python_implementation != "PyPy" and extra == "testing"
Requires-Dist: pytest-enabler>=1.3; extra == "testing"
Requires-Dist: pytest-ruff; extra == "testing"
Provides-Extra: docs
Requires-Dist: sphinx>=3.5; extra == "docs"
Requires-Dist: jaraco.packaging>=9; extra == "docs"
Requires-Dist: rst.linker>=1.9; extra == "docs"
Requires-Dist: furo; extra == "docs"
Requires-Dist: sphinx-lint; extra == "docs"
Dynamic: license-file

.. image:: https://img.shields.io/pypi/v/pytest-perf.svg
   :target: https://pypi.org/project/pytest-perf

.. image:: https://img.shields.io/pypi/pyversions/pytest-perf.svg

.. image:: https://github.com/jaraco/pytest-perf/workflows/tests/badge.svg
   :target: https://github.com/jaraco/pytest-perf/actions?query=workflow%3A%22tests%22
   :alt: tests

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :target: https://github.com/psf/black
   :alt: Code style: Black

.. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest
..    :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest

.. image:: https://img.shields.io/badge/skeleton-2023-informational
   :target: https://blog.jaraco.com/skeleton

Run performance tests against the mainline code.

Usage
=====

To use it, include pytest-perf in the test dependencies for your project, then create some Python module in your package. The plugin will include any module that contains the text "pytest_perf" and will run performance tests on each function containing "perf" in the name.

Tests don't execute the module directly, but instead parse out the code of the function in two parts, the warmup and the test, separated by a "# end warmup" comment, and then passes those to the ``timeit`` module.

See the ``exercises.py`` module for example usage.

Design
======

``pytest-perf`` works by creating two installs, the control and the experiment, and measuring the performance of some python code against each.

Under the hood, it uses ``pip-run`` to install from the upstream main branch (e.g. https://github.com/jaraco/pytest-perf) for the control and from ``.`` for the experiment. It then runs each of the experiments against each of the enviroments.
