pytest-test-groups
A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups.
What it is and what it does
pytest-test-groups is a pytest plugin that partitions your test suite into equally-sized groups, allowing you to run a single group at a time. This is primarily designed for CI environments where you want to distribute test execution across multiple workers or machines—instead of running all tests on one worker, you can split them into groups and have multiple CI jobs each run one group in parallel, reducing overall test time.
The plugin works by adding command-line options to pytest: you specify a total group count and which group number to run. It can partition tests by individual test items (the default) or by filename, and supports pseudo-random assignment of tests to groups via a seed parameter. It depends only on pytest and has low install friction.
Use it for:
- Distribute a large test suite across multiple CI workers to reduce total test time.
- Split long-running test jobs into smaller parallel jobs in GitHub Actions, GitLab CI, or similar platforms.
- Run a specific subset of tests locally for debugging without running the entire suite.
- Balance test load across CI agents when test execution time varies significantly between groups.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pytest-test-groups is a pytest plugin that splits your test suite into equally-sized groups so you can run a specific group in isolation, useful for parallelizing test execution across CI workers.
Yes, if you need to parallelize test execution in CI. The plugin is stable (Production/Stable classifier), has no known vulnerabilities, and low install friction. However, maintenance is aging—last commit was 2025-07-29. Verify compatibility with your pytest and Python versions before adopting.
Install
pytest-test-groups on PyPI
pip
pip install pytest-test-groupsuv
uv add pytest-test-groupspoetry
poetry add pytest-test-groupsInstalling pytest-test-groups
Before you install
Low install friction; depends only on pytest. Maintenance status is aging—last commit was 2025-07-29, though the repository remains active and not archived.
License in practice
MIT license (permissive). You may use, modify, and distribute this package freely in commercial or private projects, provided you include the license notice.
Quickstart
pip install pytest-test-groups
# Split tests into 10 groups and run group 2
pytest --test-group-count 10 --test-group=2
Verify before relying
- Whether the aging maintenance status affects compatibility with recent pytest versions or Python releases.
- How test grouping behaves with parameterized tests or dynamic test discovery.
- Real-world performance impact when distributing tests across many CI workers.
Package facts
| License | The MIT License (MIT) Copyright (c) 2016 Mark Adams Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pytest |
| Maintenance | aging — 463 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,559,786/month — #3,762 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_test_groups-1.2.1-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-split-testsA pytest plugin that splits your test suite…
permissive · top 15,000 on PyPI
pytest-circleci-parallelizedAdds a pytest plugin that automatically…
permissive · top 15,000 on PyPI
pytest-splitA pytest plugin that divides a test suite into…
permissive · top 5,000 on PyPI
pytest-shardDistributes pytest test execution across…
permissive · top 5,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
concurrencytestRuns unittest test suites concurrently across…
copyleft · top 15,000 on PyPI
pytest-parallelA pytest plugin that runs tests in parallel…
permissive · top 15,000 on PyPI
pytest-mypyIntegrates mypy static type checking into…
permissive · top 15,000 on PyPI
pytest-progressA pytest plugin that displays real-time test…
permissive · top 15,000 on PyPI
pytest-cacheA pytest plugin that persists test state across…
permissive · top 15,000 on PyPI