Fix issues related to running xdist with the terminal plugin disabled

This fixes an issue where the pytest plugin manager returns None if a plugin is not loaded instead of raising an error.
It also makes terminal optional in plugin code.
This commit is contained in:
Tom Boshoven
2019-09-11 19:47:16 -04:00
parent 9f9b707481
commit 32a29138fc
2 changed files with 4 additions and 6 deletions

View File

@@ -170,7 +170,8 @@ def pytest_configure(config):
session = DSession(config)
config.pluginmanager.register(session, "dsession")
tr = config.pluginmanager.getplugin("terminalreporter")
tr.showfspath = False
if tr:
tr.showfspath = False
if config.getoption("boxed"):
config.option.forked = True