update pytest-xdist

This commit is contained in:
yanchunhuo 2019-12-04 14:31:19 +08:00
parent 5ad030d398
commit eb8464ecaa
3 changed files with 30 additions and 21 deletions

View File

@ -29,15 +29,18 @@ if __name__=='__main__':
pytest_execute_params.append('-k')
pytest_execute_params.append(args.keyword)
# 判断是否输出日志
if "1"==args.capture:
pytest_execute_params.append('-s')
if args.capture:
if int(args.capture):
pytest_execute_params.append('-s')
# 判断是否失败重跑
if not "0"==args.reruns:
pytest_execute_params.append('--reruns')
pytest_execute_params.append(args.reruns)
if args.reruns:
if int(args.reruns):
pytest_execute_params.append('--reruns')
pytest_execute_params.append(args.reruns)
# 判断是否只运行上一次失败的用例
if "1"==args.lf:
pytest_execute_params.append('--lf')
if args.lf:
if int(args.lf):
pytest_execute_params.append('--lf')
pytest_execute_params.append(dir)
print('开始测试......')

View File

@ -72,15 +72,18 @@ if __name__=='__main__':
pytest_execute_params.append('-k')
pytest_execute_params.append(args.keyword)
# 判断是否输出日志
if "1"==args.capture:
pytest_execute_params.append('-s')
if args.capture:
if int(args.capture):
pytest_execute_params.append('-s')
# 判断是否失败重跑
if not "0"==args.reruns:
pytest_execute_params.append('--reruns')
pytest_execute_params.append(args.reruns)
if args.reruns:
if int(args.reruns):
pytest_execute_params.append('--reruns')
pytest_execute_params.append(args.reruns)
# 判断是否只运行上一次失败的用例
if "1"==args.lf:
pytest_execute_params.append('--lf')
if args.lf:
if int(args.lf):
pytest_execute_params.append('--lf')
pytest_execute_params.append(dir)
exit_code = pytest.main(pytest_execute_params)

View File

@ -56,15 +56,18 @@ if __name__=='__main__':
pytest_execute_params.append('-k')
pytest_execute_params.append(args.keyword)
# 判断是否输出日志
if "1"==args.capture:
pytest_execute_params.append('-s')
if args.capture:
if int(args.capture):
pytest_execute_params.append('-s')
# 判断是否失败重跑
if not "0"==args.reruns:
pytest_execute_params.append('--reruns')
pytest_execute_params.append(args.reruns)
if args.reruns:
if int(args.reruns):
pytest_execute_params.append('--reruns')
pytest_execute_params.append(args.reruns)
# 判断是否只运行上一次失败的用例
if "1"==args.lf:
pytest_execute_params.append('--lf')
if args.lf:
if int(args.lf):
pytest_execute_params.append('--lf')
pytest_execute_params.append(dir)
tmp_exit_code = pytest.main(pytest_execute_params)
if not tmp_exit_code==0: