You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

run_new.py 1.0 KiB

2 years ago
123456789101112131415161718192021222324252627
  1. # -*- coding: utf-8 -*-
  2. # @Author : leizi
  3. from testCase.ddt_case import MyTest
  4. import unittest, time, os
  5. from public import BSTestRunner
  6. BASH_DIR = "history"
  7. if __name__ == '__main__':
  8. basedir = os.path.abspath(os.path.dirname(__file__))
  9. file_dir = os.path.join(basedir, 'test_Report')
  10. file_reslut = os.path.join(file_dir, 'caseresult.yaml')
  11. try:
  12. os.remove(file_reslut)
  13. except:
  14. pass
  15. suite = unittest.TestSuite()
  16. suite.addTests(unittest.TestLoader().loadTestsFromTestCase(MyTest))
  17. now = time.strftime('%Y-%m%d', time.localtime(time.time()))
  18. file = os.path.join(file_dir, (now + '.html'))
  19. re_open = open(file, 'wb')
  20. besautiful = BSTestRunner.BSTestRunner(title="报告",
  21. description="测试报告",
  22. stream=re_open,
  23. trynum=3,
  24. filepath=BASH_DIR,
  25. is_show=True)
  26. besautiful.run(suite)

Introduction

生成接口测试报告

No topics