예제 #1
0
def run(file):
    command = "python %s" % file
    p = subprocess.Popen(command,
                     universal_newlines=True,
                     stdout=subprocess.PIPE,
                     stdin=subprocess.PIPE,
                     stderr=subprocess.STDOUT,
                     shell=True,)
    log = p.stdout.readlines()
    for line in log:
        framelog().info(line.strip())
예제 #2
0
def run(file):
    command = "python %s" % file
    p = subprocess.Popen(
        command,
        universal_newlines=True,
        stdout=subprocess.PIPE,
        stdin=subprocess.PIPE,
        stderr=subprocess.STDOUT,
        shell=True,
    )
    log = p.stdout.readlines()
    for line in log:
        framelog().info(line.strip())
예제 #3
0
def getClass(path):
    site = []
    if os.path.exists(path):
        fileAll = os.listdir(path)
        for f in fileAll:
            py_name = f.split('.')
            if py_name[-1] == 'py':
                site.append(py_name[0])
    else:
        framelog().error(u"测试目录不存在,请检查测试目录配置")
    if len(site) == 0:
        framelog().warning(u"测试目录没有可执行的测试文件")
    else:
        return site
예제 #4
0
def getClass(path):
    site = []
    if os.path.exists(path):
        fileAll = os.listdir(path)
        for f in fileAll:
            py_name = f.split('.')
            if py_name[-1] == 'py':
                site.append(py_name[0])
    else:
        framelog().error(u"测试目录不存在,请检查测试目录配置")
    if len(site) == 0:
        framelog().warning(u"测试目录没有可执行的测试文件")
    else:
        return site