wuwuwu5 最近的时间轴更新
wuwuwu5

wuwuwu5

V2EX 第 273865 号会员,加入于 2017-12-11 19:05:29 +08:00
wuwuwu5 最近回复了
2018-10-18 20:29:41 +08:00
回复了 ybw 创建的主题 程序员 你们有没有遇到这样的同事
慢性咽炎
2018-10-18 19:04:34 +08:00
回复了 HarryQu 创建的主题 MySQL Mysql 查询遇到的一个问题,我错在哪里了 ?
换个表名,我以前还用 group 做过表名😢。
2017-12-12 10:08:48 +08:00
回复了 wuwuwu5 创建的主题 Python 请教: Python coverage 和 unittest 结合报错,狗书单元测试这一块
app = creat_app('development')
app.app_context().push()
app.config['debug'] = True
manager = Manager(app)

COV = None
if os.environ.get('FLASK_COVERAGE'):
import coverage
COV = coverage.coverage(branch=True, include='app/*')
COV.start()


@manager.command
def test(cover=False):
"""run the unittest"""
if cover and not os.environ.get('FLASK_COVERAGE'):
import sys
os.environ['FLASK_COVERAGE'] = '1'
os.execvp(sys.executable, [sys.executable] + sys.argv)
import unittest
tests = unittest.TestLoader().discover('test')
unittest.TextTestRunner(verbosity=2).run(tests)
if COV:
COV.stop()
COV.save()
print 'Coverage Summary:'
COV.report()
basedir = os.path.abspath(os.path.dirname(__file__))
covdir = os.path.join(basedir, 'tmp/coverage')
COV.html_report(directory=covdir)
print 'html version: file://%s/index.html' % covdir
COV.erase()


if __name__ == '__main__':
print app.url_map
db.drop_all()
db.create_all()
manager.run()
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1774 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 16:28 · PVG 00:28 · LAX 09:28 · JFK 12:28
Developed with CodeLauncher
♥ Do have faith in what you're doing.