Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup method 'shell_context_processor' can no longer be called #7

Closed
HLFH opened this issue Nov 2, 2022 · 1 comment
Closed

setup method 'shell_context_processor' can no longer be called #7

HLFH opened this issue Nov 2, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@HLFH
Copy link
Owner

HLFH commented Nov 2, 2022

New setupmethod behaviour for flask 2.2.0: pallets/flask#4577

With:

make devtest

We get:

    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.

EDIT:

pip3.9 uninstall coverage
pip install -r requirements-ci.txt
@HLFH HLFH changed the title new setupmethod behaviour for flask make devtest raises AssertionError Nov 2, 2022
HLFH added a commit that referenced this issue Nov 2, 2022
HLFH added a commit that referenced this issue Nov 2, 2022
@HLFH HLFH self-assigned this Nov 10, 2022
@HLFH HLFH added the bug Something isn't working label Nov 10, 2022
@HLFH
Copy link
Owner Author

HLFH commented Nov 16, 2022

Flask downgrade removed.

Fixed by: 5158b6e
Flask issue to request doc: pallets/flask#4868

We had to define the app object within the basic application factory create_app.

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 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 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 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
@HLFH HLFH closed this as completed Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant