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
raise AssertionError(
AssertionError: The setup method 'shell_context_processor' can no longer be called on the application. It has already handled its first request, any changes will not be applied consistently.
Make sure all imports, decorators, functions, etc. needed to set up the application are done before running it.
If you move the creation of the application object into a function, you can then create multiple instances of this app later.
So why would you want to do this?
Testing. You can have instances of the application with different settings to test every case.
Multiple instances. Imagine you want to run different versions of the same application. Of course you could have multiple instances with different configs set up in your webserver, but if you use factories, you can have multiple instances of the same application running in the same application process which can be handy.
HLFH
changed the title
make devtest raises AssertionError
The setup method 'shell_context_processor' can no longer be called on the application
Nov 16, 2022
HLFH
changed the title
The setup method 'shell_context_processor' can no longer be called on the application
setup method 'shell_context_processor' can no longer be called on the application
Nov 16, 2022
HLFH
changed the title
setup method 'shell_context_processor' can no longer be called on the application
setup method 'shell_context_processor' can no longer be called
Nov 16, 2022
New setupmethod behaviour for flask 2.2.0: pallets/flask#4577
With:
We get:
EDIT:
The text was updated successfully, but these errors were encountered: