Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pytest-cdist"
version = "0.4.0"
version = "0.5.0"
description = "A pytest plugin to split your test suite into multiple parts"
authors = [
{ name = "Janek Nouvertné", email = "provinzkraut@posteo.de" },
Expand Down
3 changes: 3 additions & 0 deletions pytest_cdist/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ def pytest_collection_modifyitems(
if cdist_config is None:
return

if cdist_config.total_groups == 1:
return

groups = _partition_list(items, cdist_config.total_groups)

for group_steal in cdist_config.group_steal:
Expand Down
13 changes: 13 additions & 0 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
import pytest


def test_disable_on_one_group(pytester: pytest.Pytester) -> None:
pytester.makepyfile("""
def test_one():
assert True

def test_two():
assert True
""")

result = pytester.runpytest("--cdist-group=1/1")
result.assert_outcomes(passed=2, deselected=0)


def test_split_simple(pytester: pytest.Pytester) -> None:
pytester.makepyfile("""
def test_one():
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.