Merge pull request #33 from nicoddemus/disabled-subplugins
Make xdist work even if looponfail or boxed are disabled
This commit is contained in:
11
CHANGELOG
11
CHANGELOG
@@ -1,8 +1,13 @@
|
||||
1.13.2
|
||||
-------
|
||||
1.13.2.dev
|
||||
----------
|
||||
|
||||
- fix README display on pypi
|
||||
|
||||
- fix readme display on pypi
|
||||
- fix #22: xdist now works if the internal tmpdir plugin is disabled.
|
||||
Thanks Bruno Oliveira for the PR.
|
||||
|
||||
- fix #32: xdist now works if looponfail or boxed are disabled.
|
||||
Thanks Bruno Oliveira for the PR.
|
||||
|
||||
|
||||
1.13.1
|
||||
|
||||
@@ -535,6 +535,19 @@ def test_tmpdir_disabled(testdir):
|
||||
result.stdout.fnmatch_lines("*1 passed*")
|
||||
|
||||
|
||||
@pytest.mark.parametrize('plugin', ['xdist.looponfail', 'xdist.boxed'])
|
||||
def test_sub_plugins_disabled(testdir, plugin):
|
||||
"""Test that xdist doesn't break if we disable any of its sub-plugins. (#32)
|
||||
"""
|
||||
p1 = testdir.makepyfile("""
|
||||
def test_ok():
|
||||
pass
|
||||
""")
|
||||
result = testdir.runpytest(p1, "-n1", '-p', 'no:%s' % plugin)
|
||||
assert result.ret == 0
|
||||
result.stdout.fnmatch_lines("*1 passed*")
|
||||
|
||||
|
||||
class TestNodeFailure:
|
||||
def test_load_single(self, testdir):
|
||||
f = testdir.makepyfile("""
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user