From 5568c96956668f0b84a4fa78aa2ee3c046633e5e Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Wed, 23 Apr 2025 10:10:21 +0900 Subject: [PATCH] Document command line arguments in readme I've figured this out by trial and error, feel free to correct! --- README.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.rst b/README.rst index db109fa..655bac2 100644 --- a/README.rst +++ b/README.rst @@ -41,3 +41,28 @@ 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. + + +Command-line Arguments +---------------------- + +.. option:: --test-group-count + + Total number of groups to split the tests into. There must be at least this many tests. + +.. option:: --test-group + + The ``[1, N]`` test group to run, where ``N`` is the ``--test-group-count`` argument. + Use ``0`` to run all tests. + +.. option:: --test-group-random-seed + + If provided, assigns tests to groups pseudo-randomly using the given seed. + The default is a consisten order based on test node id hash. + +.. option:: --test-group-by + + Method for assigning tests to groups. Valid options are: + + - ``item`` (default): Split by individual test items (default behavior). + - ``filename``: Split by test files, all tests from a single file remain in the same group.