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())
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())
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