2 Star 0 Fork 1

行云流水/discover-flask

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
manage.py 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
Michael Herman 提交于 2015-01-03 12:24 . coverage updates
import unittest
import os
import coverage
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
from project import app, db
app.config.from_object(os.environ['APP_SETTINGS'])
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
@manager.command
def test():
"""Runs the unit tests without coverage."""
tests = unittest.TestLoader().discover('tests')
unittest.TextTestRunner(verbosity=2).run(tests)
@manager.command
def cov():
"""Runs the unit tests with coverage."""
cov = coverage.coverage(
branch=True,
include='project/*'
)
cov.start()
tests = unittest.TestLoader().discover('tests')
unittest.TextTestRunner(verbosity=2).run(tests)
cov.stop()
cov.save()
print 'Coverage Summary:'
cov.report()
basedir = os.path.abspath(os.path.dirname(__file__))
covdir = os.path.join(basedir, 'coverage')
cov.html_report(directory=covdir)
cov.erase()
if __name__ == '__main__':
manager.run()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/1qaz_zhouqi/discover-flask.git
git@gitee.com:1qaz_zhouqi/discover-flask.git
1qaz_zhouqi
discover-flask
discover-flask
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385