Skip to main content

py.test fixture for benchmarking code

Project description

Travis-CI Build Status AppVeyor Build Status Coverage Status PYPI Package PYPI Package

py.test fixture for benchmarking code

  • Free software: BSD license

Installation

pip install pytest-benchmark

Usage

def test_my_stuff(benchmark):
    with benchmark:
        # Code to be measured
        result = time.sleep(0.000001)

    # Extra code, to verify that the run completed correctly.
    # Note: this code is not measured.
    assert result is None

Documentation

https://pytest-benchmark.readthedocs.org/

Obligatory screenshot

Screenshot of py.test summary

Development

To run the all tests run:

tox

Changelog

0.1.0 (2014-10-10)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-benchmark-0.6.0.tar.gz (25.2 kB view hashes)

Uploaded Source

Built Distribution

pytest_benchmark-0.6.0-py2.py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page