pytest-sort 0.0.1__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,191 @@
1
+ Metadata-Version: 2.1
2
+ Name: pytest-sort
3
+ Version: 0.0.3
4
+ Summary: Tools for sorting test cases
5
+ Author-email: Peter Busch <pbuschmail-pytestsort@yahoo.com>
6
+ Maintainer-email: Peter Busch <pbuschmail-pytestsort@yahoo.com>
7
+ License: MIT License
8
+
9
+ Copyright (c) 2023 Peter Busch
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ Project-URL: Homepage, https://github.com/WiredNerd/pytest-sort
30
+ Project-URL: Bug Tracker, https://github.com/WiredNerd/pytest-sort/issues
31
+ Keywords: test,pytest,order,sort,random,randomly
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Operating System :: OS Independent
35
+ Classifier: Framework :: Pytest
36
+ Requires-Python: >=3.8
37
+ Description-Content-Type: text/markdown
38
+ License-File: LICENSE
39
+
40
+ ![python>=3.8](https://img.shields.io/badge/python->=3.8-blue)
41
+
42
+ # Project description
43
+
44
+ pytest-sort is a pytest plugin to automatically change the execution order of test cases. Changing the order of execution can help find test cases that only succeed because of a favorable state.
45
+
46
+ This plugin provides several options for controlling how the test cases are reordered.
47
+
48
+ # Quick Start
49
+
50
+ Installation:
51
+
52
+ ```
53
+ pip install pytest-sort --upgrade
54
+ ```
55
+
56
+ Running with pytest-sort:
57
+
58
+ ```
59
+ pytest --sort_mode=random
60
+ ```
61
+
62
+ By default, all tests from the same module will run together. This command will run the tests within the module in a random order.
63
+
64
+ ```
65
+ pytest --help
66
+ ```
67
+
68
+ In the pytest-sort section, all currently avaialable options will be listed.
69
+
70
+ You may also set options in any [pytest configruation file](https://docs.pytest.org/en/stable/reference/customize.html).
71
+
72
+ # Usage
73
+
74
+ Ideally, all test cases should be small and independant. This package provides several options for validating if test cases can really be run independantly, or if running them in a specific order is required.
75
+
76
+ ## Deterministic but Unpredictable
77
+
78
+ The Junit package automatically runs test cases in a deterministic, but unpredictable order. This package can provide similar functionality in pytest several ways.
79
+
80
+ 1. Using sort mode "md5" will produce the same order of tests every time as long as the test case names don't change.
81
+ ```toml
82
+ sort_mode="md5"
83
+ ```
84
+ 2. Using sort mode "random" with a fixed sort seed value will produce the same order of tests every time unles the list of test cases is changed (new test case, or name changes)
85
+ ```toml
86
+ sort_mode="random"
87
+ sort_seed=100
88
+ ```
89
+
90
+ ## Random
91
+
92
+ By running in random mode, the test case order will change every time. If a test case fails unexpectedly, you can use the seed from the failed run to determine what order is causing the tests to fail.
93
+
94
+ ```toml
95
+ sort_mode="random"
96
+ ```
97
+
98
+ ## Fail Fast
99
+
100
+ When you have a test suite that includes long running test cases, it can be helpful to delay the longer running test cases till later. The 'fastest' mode allows you to track how long different test cases take to run. Then always run the fastest test cases first, and the slow test cases last.
101
+ ```cmd
102
+ pytest --exitfirst --sort-mode=fastest
103
+ ```
104
+
105
+
106
+ # Options
107
+
108
+ ## Sort Mode
109
+
110
+ This option controlls how the order is modified within each bucket.
111
+
112
+ This option must be set to something other than "none" to enable pytest_sort plugin.
113
+
114
+ ***Command Line:*** `--sort-mode`
115
+
116
+ ***Pytest Config:*** `sort_mode`
117
+
118
+ ***Default:*** `none`
119
+
120
+ | Option | Definition |
121
+ | --- | --- |
122
+ | none | pytest_sort will not modify the sort order. This option disables pytest_sort. |
123
+ | md5 | This mode creates an md5 of each test case id, then sorts on those values. <br> This runs test cases in a deterministicly shuffled order. |
124
+ | random | Test cases are shuffled randomly |
125
+ | fastest | In each run in "fasttest" mode, the plugin will track the longest execution time for each test case in a file ".pytest-sort". <br> At the beginning of a test run, any previously recorded values will be used to sort the tests so that the fastest test runs first.
126
+
127
+ ## Sort Bucket
128
+
129
+ Sort test order within specified test buckets.
130
+
131
+ For example, if the sort bucket is "module", then all tests from the same module will be completed before running tests for the next module.
132
+
133
+ ***Command Line:*** `--sort-bucket`
134
+
135
+ ***Pytest Config:*** `sort_bucket`
136
+
137
+ ***Default:*** `module`
138
+
139
+ | Option | Definition |
140
+ | --- | --- |
141
+ | global | Apply sort to all items together. |
142
+ | package | Group together test cases that are in the same package (folder). |
143
+ | module | Group together test cases that are in the same module (py file). |
144
+ | class | Group together test cases that are members of a class. <br>All other (non-class) test cases are grouped by module. |
145
+ | parent | Group together test cases by their immediate parent. |
146
+ | grandparent | Group together test cases by their parent's parent. |
147
+
148
+ ## Sort Seed
149
+
150
+ Only used in "random" sort mode. This field allows you to manually set the seed used by random package when sorting tests.
151
+
152
+ > Tip: Seed is printed in the pytest header
153
+
154
+ ***Command Line:*** `--sort-seed`
155
+
156
+ ***Pytest Config:*** `sort_seed`
157
+
158
+ ***Default:*** A random integer between 0 and 1,000,000 generated at runtime.
159
+
160
+ ## Record Test Runtimes
161
+
162
+ This option enables or disables pytest_sort to record test case runtimes. These runtimes are used when sort mode is "fastest". When sort mode is "fastest" recording is enabled by default, otherwise this is disabled by default.
163
+
164
+ ***Command Line:*** `--sort-record-times/--sort-no-record-times`
165
+
166
+ ***Pytest Config:*** `sort_record_times`
167
+
168
+ ***Default:*** false
169
+
170
+ | Option | Definition |
171
+ | --- | --- |
172
+ | `--sort-record-times`<br>`sort_record_times=true` | Record test case runtime statistics |
173
+ | `--sort-no-record-times`<br>`sort_record_times=false` | Disable recording runtime statistics in "fastest" mode |
174
+
175
+ ## Reset Recorded Test Runtimes
176
+
177
+ Clear all recorded runtimes before sorting the next test.
178
+
179
+ When recording runtimes, only the highest runtime values for each test case are retained. After significant changes to test cases that can change how fast they run, it is advisable to reset the runtimes. This can help maintain more accurate sorting in "fastest" mode.
180
+
181
+ ***Command Line:*** `--sort-reset-times`
182
+
183
+ ***Pytest Config:*** N/A
184
+
185
+ ## Report Recorded Test Runtimes
186
+
187
+ At the end of the test run, print out the currently saved test runtimes.
188
+
189
+ ***Command Line:*** `--sort-reset-times`
190
+
191
+ ***Pytest Config:*** N/A
@@ -0,0 +1,152 @@
1
+ ![python>=3.8](https://img.shields.io/badge/python->=3.8-blue)
2
+
3
+ # Project description
4
+
5
+ pytest-sort is a pytest plugin to automatically change the execution order of test cases. Changing the order of execution can help find test cases that only succeed because of a favorable state.
6
+
7
+ This plugin provides several options for controlling how the test cases are reordered.
8
+
9
+ # Quick Start
10
+
11
+ Installation:
12
+
13
+ ```
14
+ pip install pytest-sort --upgrade
15
+ ```
16
+
17
+ Running with pytest-sort:
18
+
19
+ ```
20
+ pytest --sort_mode=random
21
+ ```
22
+
23
+ By default, all tests from the same module will run together. This command will run the tests within the module in a random order.
24
+
25
+ ```
26
+ pytest --help
27
+ ```
28
+
29
+ In the pytest-sort section, all currently avaialable options will be listed.
30
+
31
+ You may also set options in any [pytest configruation file](https://docs.pytest.org/en/stable/reference/customize.html).
32
+
33
+ # Usage
34
+
35
+ Ideally, all test cases should be small and independant. This package provides several options for validating if test cases can really be run independantly, or if running them in a specific order is required.
36
+
37
+ ## Deterministic but Unpredictable
38
+
39
+ The Junit package automatically runs test cases in a deterministic, but unpredictable order. This package can provide similar functionality in pytest several ways.
40
+
41
+ 1. Using sort mode "md5" will produce the same order of tests every time as long as the test case names don't change.
42
+ ```toml
43
+ sort_mode="md5"
44
+ ```
45
+ 2. Using sort mode "random" with a fixed sort seed value will produce the same order of tests every time unles the list of test cases is changed (new test case, or name changes)
46
+ ```toml
47
+ sort_mode="random"
48
+ sort_seed=100
49
+ ```
50
+
51
+ ## Random
52
+
53
+ By running in random mode, the test case order will change every time. If a test case fails unexpectedly, you can use the seed from the failed run to determine what order is causing the tests to fail.
54
+
55
+ ```toml
56
+ sort_mode="random"
57
+ ```
58
+
59
+ ## Fail Fast
60
+
61
+ When you have a test suite that includes long running test cases, it can be helpful to delay the longer running test cases till later. The 'fastest' mode allows you to track how long different test cases take to run. Then always run the fastest test cases first, and the slow test cases last.
62
+ ```cmd
63
+ pytest --exitfirst --sort-mode=fastest
64
+ ```
65
+
66
+
67
+ # Options
68
+
69
+ ## Sort Mode
70
+
71
+ This option controlls how the order is modified within each bucket.
72
+
73
+ This option must be set to something other than "none" to enable pytest_sort plugin.
74
+
75
+ ***Command Line:*** `--sort-mode`
76
+
77
+ ***Pytest Config:*** `sort_mode`
78
+
79
+ ***Default:*** `none`
80
+
81
+ | Option | Definition |
82
+ | --- | --- |
83
+ | none | pytest_sort will not modify the sort order. This option disables pytest_sort. |
84
+ | md5 | This mode creates an md5 of each test case id, then sorts on those values. <br> This runs test cases in a deterministicly shuffled order. |
85
+ | random | Test cases are shuffled randomly |
86
+ | fastest | In each run in "fasttest" mode, the plugin will track the longest execution time for each test case in a file ".pytest-sort". <br> At the beginning of a test run, any previously recorded values will be used to sort the tests so that the fastest test runs first.
87
+
88
+ ## Sort Bucket
89
+
90
+ Sort test order within specified test buckets.
91
+
92
+ For example, if the sort bucket is "module", then all tests from the same module will be completed before running tests for the next module.
93
+
94
+ ***Command Line:*** `--sort-bucket`
95
+
96
+ ***Pytest Config:*** `sort_bucket`
97
+
98
+ ***Default:*** `module`
99
+
100
+ | Option | Definition |
101
+ | --- | --- |
102
+ | global | Apply sort to all items together. |
103
+ | package | Group together test cases that are in the same package (folder). |
104
+ | module | Group together test cases that are in the same module (py file). |
105
+ | class | Group together test cases that are members of a class. <br>All other (non-class) test cases are grouped by module. |
106
+ | parent | Group together test cases by their immediate parent. |
107
+ | grandparent | Group together test cases by their parent's parent. |
108
+
109
+ ## Sort Seed
110
+
111
+ Only used in "random" sort mode. This field allows you to manually set the seed used by random package when sorting tests.
112
+
113
+ > Tip: Seed is printed in the pytest header
114
+
115
+ ***Command Line:*** `--sort-seed`
116
+
117
+ ***Pytest Config:*** `sort_seed`
118
+
119
+ ***Default:*** A random integer between 0 and 1,000,000 generated at runtime.
120
+
121
+ ## Record Test Runtimes
122
+
123
+ This option enables or disables pytest_sort to record test case runtimes. These runtimes are used when sort mode is "fastest". When sort mode is "fastest" recording is enabled by default, otherwise this is disabled by default.
124
+
125
+ ***Command Line:*** `--sort-record-times/--sort-no-record-times`
126
+
127
+ ***Pytest Config:*** `sort_record_times`
128
+
129
+ ***Default:*** false
130
+
131
+ | Option | Definition |
132
+ | --- | --- |
133
+ | `--sort-record-times`<br>`sort_record_times=true` | Record test case runtime statistics |
134
+ | `--sort-no-record-times`<br>`sort_record_times=false` | Disable recording runtime statistics in "fastest" mode |
135
+
136
+ ## Reset Recorded Test Runtimes
137
+
138
+ Clear all recorded runtimes before sorting the next test.
139
+
140
+ When recording runtimes, only the highest runtime values for each test case are retained. After significant changes to test cases that can change how fast they run, it is advisable to reset the runtimes. This can help maintain more accurate sorting in "fastest" mode.
141
+
142
+ ***Command Line:*** `--sort-reset-times`
143
+
144
+ ***Pytest Config:*** N/A
145
+
146
+ ## Report Recorded Test Runtimes
147
+
148
+ At the end of the test run, print out the currently saved test runtimes.
149
+
150
+ ***Command Line:*** `--sort-reset-times`
151
+
152
+ ***Pytest Config:*** N/A
@@ -5,11 +5,13 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "pytest-sort"
7
7
  description = "Tools for sorting test cases"
8
- version = "0.0.1"
8
+ version = "0.0.3"
9
9
  license = { file = "LICENSE" }
10
10
  keywords = ["test", "pytest", "order", "sort", "random", "randomly"]
11
11
  authors = [{ name = "Peter Busch", email = "pbuschmail-pytestsort@yahoo.com" }]
12
- maintainers = [{ name = "Peter Busch", email = "pbuschmail-pytestsort@yahoo.com" }]
12
+ maintainers = [
13
+ { name = "Peter Busch", email = "pbuschmail-pytestsort@yahoo.com" },
14
+ ]
13
15
  readme = "README.md"
14
16
  requires-python = ">=3.8"
15
17
  classifiers = [
@@ -24,9 +26,6 @@ dependencies = ["pytest>=7.0.0", "pony>=0.7.16"]
24
26
  "Homepage" = "https://github.com/WiredNerd/pytest-sort"
25
27
  "Bug Tracker" = "https://github.com/WiredNerd/pytest-sort/issues"
26
28
 
27
- #[tool.setuptools]
28
- #py-modules = ["pytest_sort"]
29
-
30
29
  [project.entry-points."pytest11"]
31
30
  sort = "pytest_sort.plugin"
32
31
 
@@ -34,6 +33,9 @@ sort = "pytest_sort.plugin"
34
33
  pythonpath = ["src"]
35
34
  testpaths = ["test"]
36
35
  addopts = "-vv -p pytester --cov-reset --cov-report=html --cov-report=term"
36
+ sort_mode = "random"
37
+ sort_bucket = "global"
38
+ sort_record_times = true
37
39
 
38
40
  # https://pytest-cov.readthedocs.io/en/latest/config.html
39
41
  # https://coverage.readthedocs.io/en/latest/config.html
@@ -49,58 +51,25 @@ skip_covered = true
49
51
 
50
52
  [tool.black]
51
53
  line-length = 120
52
- target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
54
+ target-version = ['py38', 'py39', 'py310', 'py311']
53
55
  skip-string-normalization = true
54
- diff = true
55
56
  color = true
56
57
 
57
58
  [tool.isort]
58
59
  profile = 'black'
59
60
 
60
61
  [tool.mypy]
62
+ files = "src"
61
63
 
62
64
  [tool.ruff]
63
- select = [
64
- "E",
65
- "F",
66
- "W",
67
- "C90",
68
- "I",
69
- "N",
70
- "D",
71
- "UP",
72
- "YTT",
73
- "ANN",
74
- "S",
75
- "BLE",
76
- "FBT",
77
- "B",
78
- "A",
79
- "COM",
80
- "C4",
81
- "EM",
82
- "FA",
83
- "ISC",
84
- "ICN",
85
- "G",
86
- "PIE",
87
- "T20",
88
- "PYI",
89
- "PT",
90
- "RSE",
91
- "RET",
92
- "SLF",
93
- "SIM",
94
- "TID",
95
- "TCH",
96
- "INT",
97
- "PTH",
98
- "TD",
99
- "FIX",
100
- "ERA",
101
- "PL",
102
- "PERF",
103
- "RUF",
65
+ target-version = "py38"
66
+ select = ["ALL"]
67
+ ignore = [
68
+ "D203", # 1 blank line required before class docstring
69
+ "D213", # multi-line-summary-second-line
70
+ "EM101", # Exception must not use a string literal, assign to variable first
71
+ "S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
72
+ "TRY003", # Avoid specifying long messages outside the exception class
104
73
  ]
105
74
  line-length = 120
106
75
  exclude = [
@@ -0,0 +1 @@
1
+ """pytest-sort is a pytest plugin to automatically change the execution order of test cases."""
@@ -0,0 +1,72 @@
1
+ """Container for configuration of pytest_sort."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import random
6
+ from typing import TYPE_CHECKING, Any
7
+
8
+ if TYPE_CHECKING:
9
+ import pytest
10
+
11
+
12
+ class SortConfig:
13
+ """Statoc class for storing configuration of pytest_sort."""
14
+
15
+ mode: str = "none"
16
+ bucket: str = "module"
17
+ record: bool | None = False
18
+ reset: bool = False
19
+ report: bool = False
20
+
21
+ seed = random.randint(0, 1_000_000)
22
+
23
+ @staticmethod
24
+ def from_pytest(config: pytest.Config) -> None:
25
+ """Extract pytest_sort settings from pytest's Config options and ini data."""
26
+ SortConfig.mode = config.getoption("sort_mode") or config.getini("sort_mode") or "none"
27
+ SortConfig.bucket = config.getoption("sort_bucket") or config.getini("sort_bucket") or "module"
28
+
29
+ if config.getoption("sort_no_record") and config.getoption("sort_record"):
30
+ raise ValueError("Do not use both --sort-record-times and --sort-no-record-times")
31
+
32
+ if config.getoption("sort_no_record"):
33
+ SortConfig.record = False
34
+ else:
35
+ SortConfig.record = config.getoption("sort_record") or config.getini("sort_record_times")
36
+ # getini returns [] when option not specified
37
+ if not isinstance(SortConfig.record, bool):
38
+ SortConfig.record = None
39
+ if SortConfig.mode == "fastest" and SortConfig.record is None:
40
+ SortConfig.record = True
41
+
42
+ SortConfig.reset = config.getoption("sort_reset_times", default=False)
43
+ SortConfig.report = config.getoption("sort_report_times", default=False)
44
+
45
+ SortConfig.seed = config.getoption("sort_seed") or config.getini("sort_seed") or SortConfig.seed
46
+
47
+ @staticmethod
48
+ def header_dict() -> dict:
49
+ """Construct dict of pytest_sort configuration data for use in displaying header.
50
+
51
+ Skips settings that are not currently in use.
52
+ """
53
+ config: dict[str, Any] = {
54
+ "sort-mode": SortConfig.mode,
55
+ }
56
+
57
+ if SortConfig.mode == "random":
58
+ config["sort-seed"] = SortConfig.seed
59
+
60
+ if SortConfig.mode != "none":
61
+ config["sort-bucket"] = SortConfig.bucket
62
+
63
+ if SortConfig.reset:
64
+ config["sort-reset-times"] = True
65
+
66
+ if SortConfig.record is not None:
67
+ config["sort-record-times"] = SortConfig.record
68
+
69
+ if SortConfig.report:
70
+ config["sort-report-times"] = True
71
+
72
+ return config
@@ -0,0 +1,97 @@
1
+ """Manages pony database for pytest_sort plugin."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from functools import wraps
6
+ from pathlib import Path
7
+ from typing import Any, Callable
8
+
9
+ from pony.orm import Database, OperationalError, PrimaryKey, Required, db_session
10
+
11
+ database_file = Path.cwd() / ".pytest_sort"
12
+ db = Database()
13
+
14
+
15
+ class TestTab(db.Entity): # type: ignore[name-defined]
16
+ """Records data for each Test Case by nodeid."""
17
+
18
+ nodeid = PrimaryKey(str)
19
+ setup = Required(int, size=64)
20
+ call = Required(int, size=64)
21
+ teardown = Required(int, size=64)
22
+ total = Required(int, size=64)
23
+
24
+
25
+ def _init_db(f: Callable) -> Callable:
26
+ """Initialize database before running function."""
27
+
28
+ @wraps(f)
29
+ def wrapper(*args: tuple, **kwargs: dict[str, Any]): # noqa: ANN202
30
+ if not db.provider:
31
+ db.bind(provider="sqlite", filename=str(database_file), create_db=True)
32
+ try:
33
+ db.generate_mapping(create_tables=True)
34
+ except OperationalError:
35
+ db.drop_all_tables(with_all_data=True)
36
+ db.schema = None # Pony will only rebuild build tables if this is None
37
+ db.generate_mapping(create_tables=True)
38
+ return f(*args, **kwargs)
39
+
40
+ return wrapper
41
+
42
+
43
+ @_init_db
44
+ def clear_db() -> None:
45
+ """Manually drop and recreate tables."""
46
+ db.drop_all_tables(with_all_data=True)
47
+ db.schema = None # Pony will only rebuild build tables if this is None
48
+ db.generate_mapping(create_tables=True)
49
+
50
+
51
+ @_init_db
52
+ @db_session
53
+ def update_test_case(nodeid: str, setup: int = 0, call: int = 0, teardown: int = 0) -> None:
54
+ """Update Test Case Data with specfiied duration(s) and recalculate total."""
55
+ test: TestTab = TestTab.get(nodeid=nodeid)
56
+ if not test:
57
+ TestTab(nodeid=nodeid, setup=setup, call=call, teardown=teardown, total=setup + call + teardown)
58
+ else:
59
+ if test.setup < setup:
60
+ test.setup = setup
61
+ if test.call < call:
62
+ test.call = call
63
+ if test.teardown < teardown:
64
+ test.teardown = teardown
65
+ total = test.setup + test.call + test.teardown
66
+ if test.total < total:
67
+ test.total = total
68
+
69
+
70
+ @_init_db
71
+ @db_session
72
+ def get_total(nodeid: str) -> int:
73
+ """Retrieve the total duration for specified nodeid. (0 if not found)."""
74
+ test: TestTab = TestTab.get(nodeid=nodeid)
75
+ if not test:
76
+ return 0
77
+ return test.total
78
+
79
+
80
+ @_init_db
81
+ @db_session
82
+ def get_stats(nodeid: str) -> dict:
83
+ """Retrieve all stats for specified nodeid. (all zeroes if not found)."""
84
+ test = TestTab.get(nodeid=nodeid)
85
+ if not test:
86
+ return {
87
+ "setup": 0,
88
+ "call": 0,
89
+ "teardown": 0,
90
+ "total": 0,
91
+ }
92
+ return {
93
+ "setup": test.setup,
94
+ "call": test.call,
95
+ "teardown": test.teardown,
96
+ "total": test.total,
97
+ }