add '--numprocesses' as long option for '-n'
This is more verbose in scripts that run pytest-xdist. It can also help in some ci-helper scripts like to auto detect if pytest-xdist should be installed.
This commit is contained in:
1
changelog/168.feature
Normal file
1
changelog/168.feature
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Add long option `--numprocesses` as alternative for `-n`.
|
||||||
@@ -20,6 +20,10 @@ def test_dist_options(testdir):
|
|||||||
check_options(config)
|
check_options(config)
|
||||||
assert config.option.dist == "load"
|
assert config.option.dist == "load"
|
||||||
assert config.option.tx == ['popen'] * 2
|
assert config.option.tx == ['popen'] * 2
|
||||||
|
config = testdir.parseconfigure("--numprocesses 2")
|
||||||
|
check_options(config)
|
||||||
|
assert config.option.dist == "load"
|
||||||
|
assert config.option.tx == ['popen'] * 2
|
||||||
config = testdir.parseconfigure("-d")
|
config = testdir.parseconfigure("-d")
|
||||||
check_options(config)
|
check_options(config)
|
||||||
assert config.option.dist == "load"
|
assert config.option.dist == "load"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ def parse_numprocesses(s):
|
|||||||
def pytest_addoption(parser):
|
def pytest_addoption(parser):
|
||||||
group = parser.getgroup("xdist", "distributed and subprocess testing")
|
group = parser.getgroup("xdist", "distributed and subprocess testing")
|
||||||
group._addoption(
|
group._addoption(
|
||||||
'-n', dest="numprocesses", metavar="numprocesses",
|
'-n', '--numprocesses', dest="numprocesses", metavar="numprocesses",
|
||||||
action="store",
|
action="store",
|
||||||
type=parse_numprocesses,
|
type=parse_numprocesses,
|
||||||
help="shortcut for '--dist=load --tx=NUM*popen', "
|
help="shortcut for '--dist=load --tx=NUM*popen', "
|
||||||
|
|||||||
Reference in New Issue
Block a user