https://github.com/mark-adams/pytest-test-groups
A Pytest plugin that gives you a way to split your tests into groups of a specific size
https://github.com/mark-adams/pytest-test-groups
pytest pytest-plugin
Last synced: 20 days ago
JSON representation
A Pytest plugin that gives you a way to split your tests into groups of a specific size
- Host: GitHub
- URL: https://github.com/mark-adams/pytest-test-groups
- Owner: mark-adams
- License: mit
- Created: 2016-01-28T15:49:42.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2025-07-29T03:11:50.000Z (7 months ago)
- Last Synced: 2025-08-31T03:51:59.772Z (6 months ago)
- Topics: pytest, pytest-plugin
- Language: Python
- Size: 61.5 KB
- Stars: 56
- Watchers: 4
- Forks: 28
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
.. image:: https://img.shields.io/pypi/v/pytest-test-groups.svg
:target: https://pypi.org/project/pytest-test-groups/
.. image:: https://img.shields.io/pypi/pyversions/pytest-test-groups.svg
:target: https://pypi.org/project/pytest-test-groups/
.. image:: https://github.com/mark-adams/pytest-test-groups/actions/workflows/python-tests.yml/badge.svg
:target: https://github.com/mark-adams/pytest-test-groups/actions?query=workflow%3Apython-tests
Welcome to pytest-test-groups!
==============================
pytest-test-groups allows you to split your test runs into groups of a specific
size to make it easier to split up your test runs.
Usage
---------------------
::
# Install pytest-test-groups
pip install pytest-test-groups
# Split the tests into 10 groups and run the second group
py.test --test-group-count 10 --test-group=2
# Assign tests pseudo-randomly into 10 groups, and run the second group
py.test --test-group-count 10 --test-group=2 --test-group-random-seed=12345
# Split the tests by files instead of items into 3 groups and run the second group.
# The groups might not be in the same size as each group contains full test files
py.test --test-group-count 10 --test-group=2 --test-group-by filename
Why would I use this?
------------------------------------------------------------------
Sometimes you may have some long running test jobs that take a
while to complete. This can be a major headache when trying to
run tests quickly. pytest-test-groups allows you to easily say
"split my tests into groups of 10 tests and run the second group".
This is primarily useful in the context of CI builds.