Registry / testing / pytest-split-tests

pytest-split-tests

JSON →
library1.1.0pypypi✓ verified 86d ago

A Pytest plugin for running a subset of your tests by splitting them into equally sized groups. Useful for parallel test execution across CI runners. Version 1.1.0 is the latest, forked from pytest-test-groups.

pip install pytest-split-tests
INSTALL
IMPORT
SIG · PYTEST-SPLIT-TESTS
P
pytest-split-tests
testingpythonv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pytest_split_tests
import pytest_split_tests
from pytest_split_tests import something
The plugin is auto-discovered; no explicit import needed. Importing is only for accessing internal helpers, not standard usage.

Run tests in group 1 of 4 groups, grouped by file, with loadscope distribution.

pytest --group=1 --groups=4 --grouped-by=file --dist=loadscope
Debug
Known issues
breakingpytest-split-tests does not support Python 2; requires Python 3.6+.
fix
Upgrade to Python 3.6+.
affects: all
deprecatedThe original project pytest-test-groups is unmaintained; pytest-split-tests is the active fork.
fix
Use pytest-split-tests instead of pytest-test-groups.
affects: < 1.0.0
gotchaBy default, --grouped-by is set to 'name' which may not distribute tests evenly across groups. Use --grouped-by=file for better distribution.
fix
Add '--grouped-by=file' to pytest command.
affects: all
gotchaThe plugin requires the --groups argument to be set; if omitted, all tests run (no splitting). This can cause silent unexpected behavior.
fix
Always specify --groups when using --group.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pytest_split_tests'
The package is installed but the plugin is not discovered because pytest is run without the correct version or the plugin is not installed in the same environment.
fix
Ensure pytest is installed in the same environment: pip install pytest pytest-split-tests
Error: --group requires --groups to be specified.
The --group argument is used without providing --groups.
fix
Use --group=<N> --groups=<TOTAL> together.
AttributeError: module 'pytest' has no attribute 'register_assert_rewrite'
Incompatible pytest version (likely too old).
fix
Upgrade pytest: pip install --upgrade pytest
Upgrade
Version history
1.1.0latest on PyPI · released Jul 30, 2021
Audit
Dependencies
pytestrequiredPlugin requires pytest to run
Agent activity
4 hits · last 30 days
node
4
Resources
pytest-split-tests — pip install pytest-split-tests · libregistry