Merge pull request #467 from TBoshoven/fix-no-terminal
Fix issues related to running xdist with the terminal plugin disabled
This commit is contained in:
1
changelog/467.bugfix.rst
Normal file
1
changelog/467.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fix crash issues related to running xdist with the terminal plugin disabled.
|
||||||
@@ -49,11 +49,8 @@ class DSession(object):
|
|||||||
self._max_worker_restart = get_default_max_worker_restart(self.config)
|
self._max_worker_restart = get_default_max_worker_restart(self.config)
|
||||||
# summary message to print at the end of the session
|
# summary message to print at the end of the session
|
||||||
self._summary_report = None
|
self._summary_report = None
|
||||||
try:
|
|
||||||
self.terminal = config.pluginmanager.getplugin("terminalreporter")
|
self.terminal = config.pluginmanager.getplugin("terminalreporter")
|
||||||
except KeyError:
|
if self.terminal:
|
||||||
self.terminal = None
|
|
||||||
else:
|
|
||||||
self.trdist = TerminalDistReporter(config)
|
self.trdist = TerminalDistReporter(config)
|
||||||
config.pluginmanager.register(self.trdist, "terminaldistreporter")
|
config.pluginmanager.register(self.trdist, "terminaldistreporter")
|
||||||
|
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ def pytest_configure(config):
|
|||||||
session = DSession(config)
|
session = DSession(config)
|
||||||
config.pluginmanager.register(session, "dsession")
|
config.pluginmanager.register(session, "dsession")
|
||||||
tr = config.pluginmanager.getplugin("terminalreporter")
|
tr = config.pluginmanager.getplugin("terminalreporter")
|
||||||
|
if tr:
|
||||||
tr.showfspath = False
|
tr.showfspath = False
|
||||||
if config.getoption("boxed"):
|
if config.getoption("boxed"):
|
||||||
config.option.forked = True
|
config.option.forked = True
|
||||||
|
|||||||
@@ -112,7 +112,10 @@ class NodeManager(object):
|
|||||||
ignores += self.config.option.rsyncignore
|
ignores += self.config.option.rsyncignore
|
||||||
ignores += self.config.getini("rsyncignore")
|
ignores += self.config.getini("rsyncignore")
|
||||||
|
|
||||||
return {"ignores": ignores, "verbose": self.config.option.verbose}
|
return {
|
||||||
|
"ignores": ignores,
|
||||||
|
"verbose": getattr(self.config.option, "verbose", False),
|
||||||
|
}
|
||||||
|
|
||||||
def rsync(self, gateway, source, notify=None, verbose=False, ignores=None):
|
def rsync(self, gateway, source, notify=None, verbose=False, ignores=None):
|
||||||
"""Perform rsync to remote hosts for node."""
|
"""Perform rsync to remote hosts for node."""
|
||||||
|
|||||||
@@ -1074,6 +1074,22 @@ def test_color_yes_collection_on_non_atty(testdir, request):
|
|||||||
assert "gw0 C / gw1 C" not in result.stdout.str()
|
assert "gw0 C / gw1 C" not in result.stdout.str()
|
||||||
|
|
||||||
|
|
||||||
|
def test_without_terminal_plugin(testdir, request):
|
||||||
|
"""
|
||||||
|
No output when terminal plugin is disabled
|
||||||
|
"""
|
||||||
|
testdir.makepyfile(
|
||||||
|
"""
|
||||||
|
def test_1():
|
||||||
|
pass
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
result = testdir.runpytest("-p", "no:terminal", "-n2")
|
||||||
|
assert result.stdout.str() == ""
|
||||||
|
assert result.stderr.str() == ""
|
||||||
|
assert result.ret == 0
|
||||||
|
|
||||||
|
|
||||||
def test_internal_error_with_maxfail(testdir):
|
def test_internal_error_with_maxfail(testdir):
|
||||||
"""
|
"""
|
||||||
Internal error when using --maxfail option (#62, #65).
|
Internal error when using --maxfail option (#62, #65).
|
||||||
|
|||||||
Reference in New Issue
Block a user