Make xdist work even if looponfail or boxed are disabled

Fix #32
This commit is contained in:
Bruno Oliveira
2015-12-12 10:26:31 -02:00
parent 8ba24ef627
commit c58d22f279
4 changed files with 27 additions and 9 deletions

View File

@@ -25,6 +25,10 @@ def pytest_addoption(parser):
def pytest_cmdline_main(config):
if config.getoption("looponfail"):
usepdb = config.getoption('usepdb') # a core option
if usepdb:
raise pytest.UsageError(
"--pdb incompatible with --looponfail.")
looponfail_main(config)
return 2 # looponfail only can get stop with ctrl-C anyway

View File

@@ -94,12 +94,8 @@ def pytest_cmdline_main(config):
config.option.dist = "load"
val = config.getvalue
if not val("collectonly"):
usepdb = config.option.usepdb # a core option
if val("looponfail"):
if usepdb:
raise pytest.UsageError(
"--pdb incompatible with --looponfail.")
elif val("dist") != "no":
usepdb = config.getoption('usepdb') # a core option
if val("dist") != "no":
if usepdb:
raise pytest.UsageError(
"--pdb incompatible with distributing tests.")