Don't create DSession in collect-only mode
This commit is contained in:
@@ -91,14 +91,15 @@ def pytest_addhooks(pluginmanager):
|
|||||||
|
|
||||||
@pytest.mark.trylast
|
@pytest.mark.trylast
|
||||||
def pytest_configure(config):
|
def pytest_configure(config):
|
||||||
if config.getoption("dist") != "no":
|
if not config.getvalue("collectonly"):
|
||||||
from xdist.dsession import DSession
|
if config.getoption("dist") != "no":
|
||||||
session = DSession(config)
|
from xdist.dsession import DSession
|
||||||
config.pluginmanager.register(session, "dsession")
|
session = DSession(config)
|
||||||
tr = config.pluginmanager.getplugin("terminalreporter")
|
config.pluginmanager.register(session, "dsession")
|
||||||
tr.showfspath = False
|
tr = config.pluginmanager.getplugin("terminalreporter")
|
||||||
if config.getoption("boxed"):
|
tr.showfspath = False
|
||||||
config.option.forked = True
|
if config.getoption("boxed"):
|
||||||
|
config.option.forked = True
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.tryfirst
|
@pytest.mark.tryfirst
|
||||||
|
|||||||
Reference in New Issue
Block a user