Пример #1
0
def main(args):
    approot = find_app_root()
    executable = os.path.join(approot, 'venv', 'bin', args.executable)
    if not os.path.exists(executable):
        logger.error("No such executable: %s", executable)
        return 1

    os.environ['SHEEP_SDK_PATH'] = site.PREFIXES[0]
    if args.executable == 'pip':
        os.environ['SHEEP_IGN_SDKPATH'] = 'true'
    activate_app(approot)

    rc = -1
    try:
        rc = call([executable] + args.arg)
    except KeyboardInterrupt:
        os.system('reset')
    return rc
Пример #2
0
def main(args):
    approot = find_app_root()
    devcfg = load_dev_config(approot)
    if not os.path.exists(os.path.join(approot, TEST_YAML)):
        create_test_yaml(approot, devcfg, TEST_YAML)

    if 'mysql' in devcfg:
        sync_database(approot, 'db_dumps.sql', sync_data=False, remote=False)

    if not os.path.exists(os.path.join(approot, 'permdir_test')):
        os.mkdir(os.path.join(approot, 'permdir_test'))

    os.environ['SHEEP_DEV_YAML'] = TEST_YAML

    nosetests = load_entry_point('nose', 'console_scripts', 'nosetests')
    sys.argv = ['sheep test']
    if os.path.exists(os.path.join(approot, 'nose.cfg')):
        sys.argv += ['-c', os.path.join(approot, 'nose.cfg')]
    sys.argv += args.arg
    activate_app(approot)
    return nosetests()
Пример #3
0
def post_fork(server, workers):
    activate_app(os.environ['SHEEP_APPROOT'])