标签: python unit-testing flask
我是烧瓶测试的新手,当我按照Testing Flask Application的程序运行The First Test时,我得到了RuntimeError: working outside of application context。我错过了什么?
RuntimeError: working outside of application context
答案 0 :(得分:0)
Flask有一个Application Context,看起来你需要做类似的事情:
with app.app_context(): #test code