#!/usr/bin/env python
#-*- coding:utf-8 -*-
from HTMLTestRunner import HTMLTestRunner
import time
import os
import unittest
now = time.strftime(u"%Y.%m.%d@%H%M%S")
filename = os.path.abspath('Report-') + now + '.html'
test_dir = os.getcwd()
test = unittest.defaultTestLoader.discover(test_dir, pattern='*t*') #获取当前路径所有含有字母't'的文件
fp = open(filename, 'wb')
# runner = unittest.TextTestRunner()
runner = HTMLTestRunner(stream=fp,
title=u'测试报告',
description=u"操作系统 :windows7,Chrome")
runner.run(test)
fp.close()