web自动化之 discover收集用例
from unittest import defaultTestLoader
from common import contants
from common import HTMLTestRunner
discover = defaultTestLoader.discover(contants.case_dir, pattern='test*.py')
with open(contants.html_file, 'wb')as fp:
runner = HTMLTestRunner.HTMLTestRunner(stream=fp, verbosity=1, title='web自动化报告', description='测试登录')
runner.run(discover)