Skip to content

Commit ec8f0f1

Browse files
authored
Support disabling implicitly via 1/1 group config (#11)
* support disabled config * bump * formatting
1 parent 6483851 commit ec8f0f1

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pytest-cdist"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
description = "A pytest plugin to split your test suite into multiple parts"
55
authors = [
66
{ name = "Janek Nouvertné", email = "provinzkraut@posteo.de" },

pytest_cdist/plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ def pytest_collection_modifyitems(
288288
if cdist_config is None:
289289
return
290290

291+
if cdist_config.total_groups == 1:
292+
return
293+
291294
groups = _partition_list(items, cdist_config.total_groups)
292295

293296
for group_steal in cdist_config.group_steal:

tests/test_plugin.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
import pytest
66

77

8+
def test_disable_on_one_group(pytester: pytest.Pytester) -> None:
9+
pytester.makepyfile("""
10+
def test_one():
11+
assert True
12+
13+
def test_two():
14+
assert True
15+
""")
16+
17+
result = pytester.runpytest("--cdist-group=1/1")
18+
result.assert_outcomes(passed=2, deselected=0)
19+
20+
821
def test_split_simple(pytester: pytest.Pytester) -> None:
922
pytester.makepyfile("""
1023
def test_one():

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)