import unittest,yagmail,time
from BeautifulReport import BeautifulReport as bf #导入BeautifulReport
if __name__ == '__main__':
#注意4个空格
#Beautiful
suit = unittest.TestSuite()
suit.addTest(Detail("test_detail"))#乘客订单详情
run = bf(suit) # 实例化beautiful
run.report(description='测试进行中', filename='oride_report',report_dir=r'C:UsershuiPycharmProjects
ew_oride
eport')
#mail
yag = yagmail.SMTP(user='xx@qq.com', password='gtn', host='smtp.qq.com', port='465')
body = "测试环境,api"
yag.send(to=['yy@qq.com'], subject='api测试中', contents=[body,r'C:UsershuiPycharmProjects
ew_oride
eportoride_report.html'])
print("已发送邮件")