Flask + SQLAlchemyアプリケーションをテストするのにPytestを使用しています。これは、私はあなたがpop()
への呼び出しとして、あなたのティアダウン機能でctx.pop()
を呼び出すことになっているとは思わない、私はpytest
を実行すると、私はこのエラーメッセージRecursionError:最大再帰深度がFlask Pytestを超えました
___________________ ERROR at teardown of test_create_project ___________________
exception = None
@_app.teardown_appcontext
def teardown(exception=None):
> ctx.pop()
tests/conftest.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../.virtualenvs/quest-backend/lib/python3.6/site-packages/flask/ctx.py:189: in pop
self.app.do_teardown_appcontext(exc)
../../.virtualenvs/quest-backend/lib/python3.6/site-packages/flask/app.py:1892: in do_teardown_appcontext
func(exc)
tests/conftest.py:31: in teardown
ctx.pop()
E RecursionError: maximum recursion depth exceeded
!!! Recursion detected (same locals & position)