environment.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:backend 作者: gitplaylist 项目源码 文件源码
def before_all(context):
    """Create the context bag."""
    # Change the configuration on the fly
    os.environ['ENV'] = 'testing'

    # Import this now because the environment variable
    # should be changed before this happens.

    context.app = create_app()

    # Create all the tables in memory.
    with context.app.app_context():
        db.create_all()

    # Create the test client.
    context.client = context.app.test_client()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号