pytest-statsd

https://travis-ci.org/jlane9/pytest-statsd.svg?branch=master https://badge.fury.io/py/pytest-statsd.svg https://img.shields.io/pypi/pyversions/pytest-statsd.svg https://img.shields.io/pypi/l/pytest-statsd.svg https://img.shields.io/pypi/status/pytest-statsd.svg https://requires.io/github/jlane9/pytest-statsd/requirements.svg?branch=master https://readthedocs.org/projects/pytest-statsd/badge/?version=latest https://api.codeclimate.com/v1/badges/c43f457e5826cedcf08f/maintainability

Plugin

pytest_statsd.plugin

class pytest_statsd.plugin.GraphiteReport(config)

Bases: object

Graphite report implementation

append_failed(report)

Add failed test metric

Parameters:report (pytest.Report) – Test case report
Returns:
append_passed(report)

Add passed test metric

Parameters:report (pytest.Report) – Test case report
Returns:
append_skipped(report)

Add skipped test metric

Parameters:report (pytest.Report) – Test case report
Returns:
pytest_runtest_logreport(report)

Add report metrics

Parameters:report (pytest.Report) – Test case report
Returns:
pytest_sessionfinish(session)

whole test run finishes

Parameters:session (pytest.Session) –
Returns:
pytest_sessionstart(session)

before test run begins

Parameters:session (pytest.Session) –
Returns:
pytest_terminal_summary(terminalreporter)

add additional section in terminal summary reporting

Parameters:terminalreporter
Returns:
pytest_statsd.plugin.pytest_addoption(parser)
Parameters:parser
Returns:
pytest_statsd.plugin.pytest_configure(config)
Parameters:config
Returns:
pytest_statsd.plugin.pytest_unconfigure(config)
Parameters:config
Returns:

Installation

Install through pip:

pip install pytest-statsd

Install from source:

cd /path/to/source/pytest-statsd
python setup.py install

Examples

To simply run using default the configuration, use:

pytest --stats-d tests/

If there is a need to configure where to sent results to other than localhost:8125, use:

pytest --stats-d --stats-host http://myserver.com --stats-port 3000 tests/

You can also prefix your results if you plan on having multiple projects sending results to the same server:

pytest --stats-d --stats-prefix myproject test/

Indices and tables