-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrun_tests.py
35 lines (29 loc) · 982 Bytes
/
run_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/12/27 14:44
# @Author : huanghe
# @Site :
# @File : run_tests.py
# @Software: PyCharm
import sys
import time
#sys.path.append('./interface')
#sys.path.append('./db_mongodb')
from baselib.htmltestrunner.HTMLTestRunner import HTMLTestRunner
#接口
#from baselib.htmltestrunner.HTMLTestRunner_in import HTMLTestRunner
import unittest
#test_dir = './TestCase/interface'
test_dir = './TestCase/webpage'
discover = unittest.defaultTestLoader.discover(test_dir,pattern='test_ad_*.py')
if __name__ == '__main__':
now = time.strftime("%Y-%m-%d %H_%M_%S")
filename = './report/' + now + '_result.html'
fp = open(filename, 'wb')
runner = HTMLTestRunner(stream=fp,
title='Aquapaas WEB ADV Test Report',
description='Implementation Example with: '
)
run = HTMLTestRunner()
runner.run(discover)
fp.close()