Add --no-loadscope-reorder and --loadscope-reorder options (#1217)
Based on #1098. Closes #1098 --------- Co-authored-by: Toan Vuong <toan.vuong@hyperscience.com>
This commit is contained in:
@@ -127,6 +127,32 @@ def pytest_addoption(parser: pytest.Parser) -> None:
|
||||
"(default) no: Run tests inprocess, don't distribute."
|
||||
),
|
||||
)
|
||||
group.addoption(
|
||||
"--loadscope-reorder",
|
||||
dest="loadscopereorder",
|
||||
action="store_true",
|
||||
default=True,
|
||||
help=(
|
||||
"Pytest-xdist will default reorder tests by number of tests per scope "
|
||||
"when used in conjunction with loadscope.\n"
|
||||
"This option will enable loadscope reorder which will improve the "
|
||||
"parallelism of the test suite.\n"
|
||||
"However, the partial order of tests might not be retained.\n"
|
||||
),
|
||||
)
|
||||
group.addoption(
|
||||
"--no-loadscope-reorder",
|
||||
dest="loadscopereorder",
|
||||
action="store_false",
|
||||
help=(
|
||||
"Pytest-xdist will default reorder tests by number of tests per scope "
|
||||
"when used in conjunction with loadscope.\n"
|
||||
"This option will disable loadscope reorder, "
|
||||
"and the partial order of tests can be retained.\n"
|
||||
"This is useful when pytest-xdist is used together with "
|
||||
"other plugins that specify tests in a specific order."
|
||||
),
|
||||
)
|
||||
group.addoption(
|
||||
"--tx",
|
||||
dest="tx",
|
||||
|
||||
Reference in New Issue
Block a user