Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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()