Skip to content
Open
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
7 changes: 6 additions & 1 deletion pytest_split_tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ def get_group(items, group_size, group_id):
start = group_size * (group_id - 1)
end = start + group_size

if start >= len(items) or start < 0:
if start < 0:
# invalid start index
raise ValueError("Invalid test-group argument")
if start >= len(items):
# return empty group for groups that remain in the group count
# beyond the remaining items
return []

return items[start:end]

Expand Down