1+ import pytest
2+
3+ @pytest .hookspec (firstresult = True )
14def pytest_benchmark_scale_unit (config , unit , benchmarks , best , worst , sort ):
25 """
36 To have custom time scaling do something like this:
@@ -19,6 +22,7 @@ def pytest_benchmark_scale_unit(config, unit, benchmarks, best, worst, sort):
1922 pass
2023
2124
25+ @pytest .hookspec (firstresult = True )
2226def pytest_benchmark_generate_machine_info (config ):
2327 """
2428 To completely replace the generated machine_info do something like this:
@@ -45,6 +49,7 @@ def pytest_benchmark_update_machine_info(config, machine_info):
4549 pass
4650
4751
52+ @pytest .hookspec (firstresult = True )
4853def pytest_benchmark_generate_commit_info (config ):
4954 """
5055 To completely replace the generated commit_info do something like this:
@@ -69,6 +74,7 @@ def pytest_benchmark_update_commit_info(config, commit_info):
6974 pass
7075
7176
77+ @pytest .hookspec (firstresult = True )
7278def pytest_benchmark_group_stats (config , benchmarks , group_by ):
7379 """
7480 You may perform grouping customization here, in case the builtin grouping doesn't suit you.
@@ -90,6 +96,7 @@ def pytest_benchmark_group_stats(config, benchmarks, group_by):
9096 pass
9197
9298
99+ @pytest .hookspec (firstresult = True )
93100def pytest_benchmark_generate_json (config , benchmarks , include_data , machine_info , commit_info ):
94101 """
95102 You should read pytest-benchmark's code if you really need to wholly customize the json.
@@ -143,10 +150,3 @@ def pytest_benchmark_compare_machine_info(config, benchmarksession, machine_info
143150 )
144151 """
145152 pass
146-
147-
148- pytest_benchmark_scale_unit .firstresult = True
149- pytest_benchmark_generate_commit_info .firstresult = True
150- pytest_benchmark_generate_json .firstresult = True
151- pytest_benchmark_generate_machine_info .firstresult = True
152- pytest_benchmark_group_stats .firstresult = True
0 commit comments