Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix update hooks specs #74

Merged
merged 3 commits into from
Apr 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/pytest_benchmark/hookspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ def pytest_benchmark_generate_machine_info(config):

.. sourcecode:: python

def pytest_benchmark_update_machine_info(config):
def pytest_benchmark_generate_machine_info(config):
return {'user': getpass.getuser()}
"""
pass


def pytest_benchmark_update_machine_info(config, info):
def pytest_benchmark_update_machine_info(config, machine_info):
"""
If benchmarks are compared and machine_info is different then warnings will be shown.

To add the current user to the commit info override the hook in your conftest.py like this:

.. sourcecode:: python

def pytest_benchmark_update_machine_info(config, info):
info['user'] = getpass.getuser()
def pytest_benchmark_update_machine_info(config, machine_info):
machine_info['user'] = getpass.getuser()
"""
pass

Expand All @@ -36,14 +36,14 @@ def pytest_benchmark_generate_commit_info(config):
pass


def pytest_benchmark_update_commit_info(config, info):
def pytest_benchmark_update_commit_info(config, commit_info):
"""
To add something into the commit_info, like the commit message do something like this:

.. sourcecode:: python

def pytest_benchmark_update_commit_info(config, info):
info['message'] = subprocess.check_output(['git', 'log', '-1', '--pretty=%B']).strip()
def pytest_benchmark_update_commit_info(config, commit_info):
commit_info['message'] = subprocess.check_output(['git', 'log', '-1', '--pretty=%B']).strip()
"""
pass

Expand Down