Source

glas_process / conftest.py


def pytest_couchdbkit_push_app(server, dbname):
    db = server.get_or_create_db(dbname)
    from glas_process.ddoc import ddoc
    db.save_doc(dict(ddoc), force_update=True)

def pytest_funcarg__procdir(request):
    tmpdir = request.getfuncargvalue('tmpdir')
    db = request.getfuncargvalue('couchdb')
    nodeid = request._pyfuncitem.nodeid

    from glas_process.procdir import ProcDir
    from juggler.model import Task
    task = Task(_id=nodeid, testcase=nodeid)
    db.save_doc(task)
    procdir = ProcDir(db, tmpdir/'proc', task)
    if 'no_create' not in request._pyfuncitem.keywords:
        procdir.path.ensure(dir=1)
    return procdir