-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (23 loc) · 727 Bytes
/
main.py
File metadata and controls
27 lines (23 loc) · 727 Bytes
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
# -*- coding:utf-8 -*-
"""
Created on 2017年5月5日
@author: lt
"""
# coding:utf-8
import unittest
import os
# 用例路径
import time
from Common.HTMLTestRunner_PY3 import HTMLTestRunner
from testreport.Send_report import send_email
case_path = os.path.join(os.getcwd())
if __name__ == '__main__':
run_time = time.strftime('%Y-%m-%d_%H_%M_%S', time.localtime(time.time()))
suite = unittest.defaultTestLoader.discover('.', 'test*.py')
fp = open(os.getcwd()+"/Report/"+run_time+".html", 'wb')
runner = HTMLTestRunner(stream=fp,
title='自动化测试报告',
description='测试报告')
runner.run(suite)
fp.close()
send_email(run_time)