def pytest_cmdline_main(config): xkill = config.option.xkill xshow = config.option.xshow if xkill or xshow: #config._do_configure() tw = py.io.TerminalWriter() rootdir = getrootdir(config) xprocess = XProcess(config, rootdir) if xkill: return xprocess._xkill(tw) if xshow: return xprocess._xshow(tw)
def xprocess(request): """yield session-scoped XProcess helper to manage long-running processes required for testing.""" rootdir = getrootdir(request.config) with XProcess(request.config, rootdir) as xproc: # pass in xprocess object into pytest_unconfigure # through config for proper cleanup during teardown request.config._xprocess = xproc yield xproc
def xprocess(request): """ Return session-scoped XProcess helper to manage long-running processes required for testing. """ rootdir = getrootdir(request.config) return XProcess(request.config, rootdir)
def xproc(request): rootdir = getrootdir(request.config) rootdir = rootdir.join(str(uuid.uuid1())[0:8]) yield XProcess(request.config, rootdir) if rootdir.exists(): rootdir.remove()