tests.py 文件源码

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

项目:MoodBot 作者: Bonanashelby 项目源码 文件源码
def configuration(request):
    """Set up a Configurator instance.

    This Configurator instance sets up a pointer to the location of the
        database.
    It also includes the models from your app's model package.
    Finally it tears everything down, including the in-memory SQLite database.

    This configuration will persist for the entire duration of your PyTest run.
    """
    config = testing.setUp(settings={
        'sqlalchemy.url': 'postgres://localhost:5432/test_moodybot'
    })
    config.include("mood_bot.models")
    config.include("mood_bot.routes")
    config.include("mood_bot.security")

    def teardown():
        testing.tearDown()

    request.addfinalizer(teardown)
    return config
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号