Commit ba316f1a by jiaqiying

fix bug

parent 722dcb8d
......@@ -7,22 +7,24 @@ from common.tools import get_case_dir
def get_parser():
parser = argparse.ArgumentParser(description="Demo of argparse")
parser = argparse.ArgumentParser(description="argparse")
parser.add_argument('--product', type=str, default=BaseConfig.current_product)
return parser
if __name__ == "__main__":
parser = get_parser()
args = get_parser()
args = parser.parse_args()
BaseConfig.current_product = args.product
# 获取要执行的产品的用例目录
test_case_dir = get_case_dir(args.product)
print("********此次执行的产品测试用例是:%s********"%test_case_dir)
#删除之前报告
for one in os.listdir('../report/tmp'):
for one in os.listdir('./report/tmp'):
if 'json' in one:
os.remove(f'../report/tmp/{one}')
os.remove(f'./report/tmp/{one}')
# 生成报告数据
pytest.main(['-v', '-s', test_case_dir, '--alluredir', '../report/tmp'])
pytest.main(['-v', '-s', test_case_dir, '--alluredir', './report/tmp'])
# 打开报告
os.system('allure serve ../report/tmp')
\ No newline at end of file
os.system('allure serve ./report/tmp')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment