Add --maxschedchunk CLI option (#857)

Maximum number of tests scheduled in one step.

Setting it to 1 will force pytest to send tests to workers one by one -
might be useful for a small number of slow tests.

Larger numbers will allow the scheduler to submit consecutive chunks of tests
to workers - allows reusing fixtures.

Unlimited if not set.

Fixes #855
Fixes #255
This commit is contained in:
Aleksandr Mezin
2022-12-23 14:21:20 +03:00
committed by GitHub
parent 7faa69a04b
commit 9b0b5b1495
4 changed files with 74 additions and 2 deletions

View File

@@ -153,6 +153,19 @@ def pytest_addoption(parser):
"on every test run."
),
)
group.addoption(
"--maxschedchunk",
action="store",
type=int,
help=(
"Maximum number of tests scheduled in one step for --dist=load. "
"Setting it to 1 will force pytest to send tests to workers one by "
"one - might be useful for a small number of slow tests. "
"Larger numbers will allow the scheduler to submit consecutive "
"chunks of tests to workers - allows reusing fixtures. "
"Unlimited if not set."
),
)
parser.addini(
"rsyncdirs",