pytest-split 0.8.1__py3-none-any.whl → 0.9.0__py3-none-any.whl
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.
- pytest_split/algorithms.py +7 -7
- pytest_split/ipynb_compatibility.py +1 -1
- pytest_split/plugin.py +4 -6
- LICENCE → pytest_split-0.9.0.dist-info/LICENSE +1 -1
- {pytest_split-0.8.1.dist-info → pytest_split-0.9.0.dist-info}/METADATA +8 -14
- pytest_split-0.9.0.dist-info/RECORD +11 -0
- {pytest_split-0.8.1.dist-info → pytest_split-0.9.0.dist-info}/WHEEL +1 -1
- pytest_split-0.8.1.dist-info/RECORD +0 -11
- {pytest_split-0.8.1.dist-info → pytest_split-0.9.0.dist-info}/entry_points.txt +0 -0
pytest_split/algorithms.py
CHANGED
|
@@ -51,12 +51,12 @@ def least_duration(
|
|
|
51
51
|
items_with_durations_indexed, key=lambda tup: tup[1], reverse=True
|
|
52
52
|
)
|
|
53
53
|
|
|
54
|
-
selected:
|
|
55
|
-
deselected:
|
|
56
|
-
duration:
|
|
54
|
+
selected: List[List[Tuple[nodes.Item, int]]] = [[] for _ in range(splits)]
|
|
55
|
+
deselected: List[List[nodes.Item]] = [[] for _ in range(splits)]
|
|
56
|
+
duration: List[float] = [0 for _ in range(splits)]
|
|
57
57
|
|
|
58
58
|
# create a heap of the form (summed_durations, group_index)
|
|
59
|
-
heap:
|
|
59
|
+
heap: List[Tuple[float, int]] = [(0, i) for i in range(splits)]
|
|
60
60
|
heapq.heapify(heap)
|
|
61
61
|
for item, item_duration, original_index in sorted_items_with_durations:
|
|
62
62
|
# get group with smallest sum
|
|
@@ -102,9 +102,9 @@ def duration_based_chunks(
|
|
|
102
102
|
items_with_durations = _get_items_with_durations(items, durations)
|
|
103
103
|
time_per_group = sum(map(itemgetter(1), items_with_durations)) / splits
|
|
104
104
|
|
|
105
|
-
selected:
|
|
106
|
-
deselected:
|
|
107
|
-
duration:
|
|
105
|
+
selected: List[List[nodes.Item]] = [[] for i in range(splits)]
|
|
106
|
+
deselected: List[List[nodes.Item]] = [[] for i in range(splits)]
|
|
107
|
+
duration: List[float] = [0 for i in range(splits)]
|
|
108
108
|
|
|
109
109
|
group_idx = 0
|
|
110
110
|
for item, item_duration in items_with_durations:
|
|
@@ -6,7 +6,7 @@ if TYPE_CHECKING:
|
|
|
6
6
|
from pytest_split.algorithms import TestGroup
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
def ensure_ipynb_compatibility(group: "TestGroup", items: list) -> None:
|
|
9
|
+
def ensure_ipynb_compatibility(group: "TestGroup", items: list) -> None: # type: ignore[type-arg]
|
|
10
10
|
"""
|
|
11
11
|
Ensures that group doesn't contain partial IPy notebook cells.
|
|
12
12
|
|
pytest_split/plugin.py
CHANGED
|
@@ -15,7 +15,7 @@ if TYPE_CHECKING:
|
|
|
15
15
|
from _pytest import nodes
|
|
16
16
|
from _pytest.config import Config
|
|
17
17
|
from _pytest.config.argparsing import Parser
|
|
18
|
-
from _pytest.main import ExitCode
|
|
18
|
+
from _pytest.main import ExitCode # type: ignore[attr-defined]
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
# Ugly hack for freezegun compatibility: https://github.com/spulec/freezegun/issues/286
|
|
@@ -193,9 +193,9 @@ class PytestSplitCachePlugin(Base):
|
|
|
193
193
|
https://github.com/pytest-dev/pytest/blob/main/src/_pytest/main.py#L308
|
|
194
194
|
"""
|
|
195
195
|
terminal_reporter = self.config.pluginmanager.get_plugin("terminalreporter")
|
|
196
|
-
test_durations:
|
|
196
|
+
test_durations: Dict[str, float] = {}
|
|
197
197
|
|
|
198
|
-
for test_reports in terminal_reporter.stats.values():
|
|
198
|
+
for test_reports in terminal_reporter.stats.values(): # type: ignore[union-attr]
|
|
199
199
|
for test_report in test_reports:
|
|
200
200
|
if isinstance(test_report, TestReport):
|
|
201
201
|
# These ifs be removed after this is solved: # https://github.com/spulec/freezegun/issues/286
|
|
@@ -224,8 +224,6 @@ class PytestSplitCachePlugin(Base):
|
|
|
224
224
|
json.dump(self.cached_durations, f, sort_keys=True, indent=4)
|
|
225
225
|
|
|
226
226
|
message = self.writer.markup(
|
|
227
|
-
"\n\n[pytest-split] Stored test durations in {}"
|
|
228
|
-
self.config.option.durations_path
|
|
229
|
-
)
|
|
227
|
+
f"\n\n[pytest-split] Stored test durations in {self.config.option.durations_path}"
|
|
230
228
|
)
|
|
231
229
|
self.writer.line(message)
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pytest-split
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Summary: Pytest plugin which splits the test suite to equally sized sub suites based on test execution time.
|
|
5
5
|
Home-page: https://jerry-git.github.io/pytest-split
|
|
6
6
|
License: MIT
|
|
7
7
|
Keywords: pytest,plugin,split,tests
|
|
8
8
|
Author: Jerry Pussinen
|
|
9
9
|
Author-email: jerry.pussinen@gmail.com
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.8.1,<4.0
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: License :: OSI Approved :: MIT License
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Classifier: Programming Language :: Python
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.9
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
-
Classifier: Programming Language :: Python :: 3
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
21
|
Classifier: Programming Language :: Python :: 3.8
|
|
26
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
27
22
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
23
|
Classifier: Typing :: Typed
|
|
29
|
-
Requires-Dist: pytest (>=5,<
|
|
24
|
+
Requires-Dist: pytest (>=5,<9)
|
|
30
25
|
Project-URL: Documentation, https://jerry-git.github.io/pytest-split
|
|
31
26
|
Project-URL: Repository, https://github.com/jerry-git/pytest-split
|
|
32
27
|
Description-Content-Type: text/markdown
|
|
@@ -129,7 +124,7 @@ The `least_duration` algorithm walks the list of tests and assigns each test to
|
|
|
129
124
|
* Clone this repository
|
|
130
125
|
* Requirements:
|
|
131
126
|
* [Poetry](https://python-poetry.org/)
|
|
132
|
-
* Python 3.
|
|
127
|
+
* Python 3.8+
|
|
133
128
|
* Create a virtual environment and install the dependencies
|
|
134
129
|
|
|
135
130
|
```sh
|
|
@@ -150,9 +145,8 @@ pytest
|
|
|
150
145
|
|
|
151
146
|
### Documentation
|
|
152
147
|
|
|
153
|
-
The documentation is automatically generated from the content of the [docs directory](
|
|
154
|
-
of the public signatures of the source code. The documentation is updated and published as a [Github
|
|
155
|
-
](https://pages.github.com/) automatically as part each release.
|
|
148
|
+
The documentation is automatically generated from the content of the [docs directory](https://github.com/jerry-git/pytest-split/tree/master/docs) and from the docstrings
|
|
149
|
+
of the public signatures of the source code. The documentation is updated and published as a [Github Pages page](https://pages.github.com/) automatically as part each release.
|
|
156
150
|
|
|
157
151
|
### Releasing
|
|
158
152
|
|
|
@@ -166,7 +160,7 @@ Find the draft release from the
|
|
|
166
160
|
|
|
167
161
|
### Pre-commit
|
|
168
162
|
|
|
169
|
-
Pre-commit hooks run all the auto-
|
|
163
|
+
Pre-commit hooks run all the auto-formatting (`ruff format`), linters (e.g. `ruff` and `mypy`), and other quality
|
|
170
164
|
checks to make sure the changeset is in good shape before a commit/push happens.
|
|
171
165
|
|
|
172
166
|
You can install the hooks with (runs for each commit):
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
pytest_split/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
pytest_split/algorithms.py,sha256=4rNNyPzZskHgorFsGId_XHi2MzjkyZ1Lj8_TZD4B60k,6112
|
|
3
|
+
pytest_split/cli.py,sha256=_Cc3h5jwOJyX7NZT4yil_ymG0g6Rw0257gh_63VoqzE,1011
|
|
4
|
+
pytest_split/ipynb_compatibility.py,sha256=zBul7z3mB3UgM03IppqFpTZTdb2Vj1NrqxRC0kAgrCw,2104
|
|
5
|
+
pytest_split/plugin.py,sha256=z3dTS3rK0wI2bj62Yw2O3y8120UfMiWnc6CJJyig-0k,7857
|
|
6
|
+
pytest_split/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
pytest_split-0.9.0.dist-info/LICENSE,sha256=mMm6KABGgOUinR1qBjELBaTHOU91sKkaWnprZ0RBilU,1058
|
|
8
|
+
pytest_split-0.9.0.dist-info/METADATA,sha256=IieeBEBthWLh2UzL7NkPRJZp0zoP-mIXjparUiVv-gQ,9480
|
|
9
|
+
pytest_split-0.9.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
10
|
+
pytest_split-0.9.0.dist-info/entry_points.txt,sha256=TQBEnYSUICZtzsc1CUyiYrOHpEll6HBDzIFvjJyo9F8,114
|
|
11
|
+
pytest_split-0.9.0.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
LICENCE,sha256=9Enb-O6zwCRmtxw3bGyfdFDKjy5LgMj-GIIMb1VXrRY,1058
|
|
2
|
-
pytest_split/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
pytest_split/algorithms.py,sha256=-lLVwVQ2BqIjqzPP7U1GH5q4crytODq0LPwNewAwEcY,6126
|
|
4
|
-
pytest_split/cli.py,sha256=_Cc3h5jwOJyX7NZT4yil_ymG0g6Rw0257gh_63VoqzE,1011
|
|
5
|
-
pytest_split/ipynb_compatibility.py,sha256=G4TxNU7FA0vdlRaAbDJGrM4Sq3n0p2gEVad-piAjnUs,2078
|
|
6
|
-
pytest_split/plugin.py,sha256=YSO4WTfH6o_Br0lFjIxzsmT4__iWyuQfRmAfScGrhsY,7839
|
|
7
|
-
pytest_split/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
pytest_split-0.8.1.dist-info/METADATA,sha256=RM4K7fqOBSIoGdAND3DL0JZ8XQeA92U--MWL4dazKHs,9677
|
|
9
|
-
pytest_split-0.8.1.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
|
10
|
-
pytest_split-0.8.1.dist-info/entry_points.txt,sha256=TQBEnYSUICZtzsc1CUyiYrOHpEll6HBDzIFvjJyo9F8,114
|
|
11
|
-
pytest_split-0.8.1.dist-info/RECORD,,
|
|
File without changes
|