Files
jiekou-python3/run_new.py

28 lines
1.0 KiB
Python
Raw Permalink Normal View History

2020-05-08 18:29:34 +08:00
# -*- coding: utf-8 -*-
# @Author : leizi
2020-05-09 21:24:18 +08:00
from testCase.ddt_case import MyTest
import unittest, time, os
2023-02-19 18:16:03 +08:00
from public import BSTestRunner
BASH_DIR = "history"
2020-05-09 21:24:18 +08:00
if __name__ == '__main__':
basedir = os.path.abspath(os.path.dirname(__file__))
file_dir = os.path.join(basedir, 'test_Report')
file_reslut = os.path.join(file_dir, 'caseresult.yaml')
try:
os.remove(file_reslut)
except:
pass
2020-05-08 18:29:34 +08:00
suite = unittest.TestSuite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(MyTest))
now = time.strftime('%Y-%m%d', time.localtime(time.time()))
file = os.path.join(file_dir, (now + '.html'))
re_open = open(file, 'wb')
besautiful = BSTestRunner.BSTestRunner(title="报告",
description="测试报告",
stream=re_open,
trynum=3,
filepath=BASH_DIR,
is_show=True)
besautiful.run(suite)