1、按command【ctrl】点击create_dir
2、跳转到htmltestreportcn,用如下代码替换如下图部分,即可解决报表文件夹重复生成问题:
dir_path = self.path + self.title
if not os.path.isdir(dir_path):
os.makedirs(dir_path)
report_path = dir_path + "/" + self.title + "V" + str(round(i, 1)) + ".html"
# 判断文件是否存在,不存在则创建
while True:
is_file = os.path.exists(report_path)
if is_file:
i += 0.1
report_path = dir_path + "/" + self.title + "V" + str(round(i, 1)) + ".html"
else:
break