You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The flask documentation says that a teardown_request hook can be called even when no requests have been processed(http://flask.pocoo.org/docs/1.0/api/#flask.Flask.teardown_request). This means that the pony integration will raise an error, as no db_session has been entered.
I think you should either:
switch this code to use an after_request, or
have the teardown request function not raise an error if a session doesn't exist.
I hit this flow because the Flask test_request_context will call the teardown function in tests even when no requests are called.
thoughts? I can adjust my currently open PR to reproduce this in #431
The text was updated successfully, but these errors were encountered:
# Bugfixes
* Python3.7 and PyPy decompiling fixes
* Fix reading NULL from Optional nullable array column
* Fix handling of empty arrays in queries
* #415: error message typo
* #432: PonyFlask - request object can trigger teardown_request without real request
* Fix GROUP CONCAT separator for MySQL
I was reading through the code and this bit jumped out at me:
https://github.com/ponyorm/pony/blob/orm/pony/flask/__init__.py#L24
The flask documentation says that a
teardown_request
hook can be called even when no requests have been processed(http://flask.pocoo.org/docs/1.0/api/#flask.Flask.teardown_request). This means that the pony integration will raise an error, as no db_session has been entered.I think you should either:
I hit this flow because the Flask
test_request_context
will call the teardown function in tests even when no requests are called.thoughts? I can adjust my currently open PR to reproduce this in #431
The text was updated successfully, but these errors were encountered: