Replies: 1 comment
-
Do you need to be able to add routes after the app has received the first request? This is problematic as the router will have been 'finalized' to handle that first request (this could have caused issues in pre 2.2.2 as well, but was unlikely). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on a REST project with a 4000+ tests and trying to update the libraries used by the project. Upgrading to flask 2.2.2 breaks a bunch of tests that are dynamically adding endpoints to the app since it now raises an AssertionError if setup has already been completed.
Is there a recommended way to work round this issue without rewriting a load of tests? The tests use a pytest fixture to create a single Flask app scoped to the session. I tried using a function-scoped fixture for the failing tests, but that did not play well with flask-sqlalchemy which associates the app with the database session.
An alternative that I have not tried yet is to monkeypatch the
Flask._check_setup_finished
method to not raise the exception, but that may cause problems in future versions of Flask if the behavour changes again or the method gets renamed.Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions