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

AuthTestApp Can't Be Used as a Context Manager #176

Open
calebsyring opened this issue Aug 23, 2023 · 1 comment
Open

AuthTestApp Can't Be Used as a Context Manager #176

calebsyring opened this issue Aug 23, 2023 · 1 comment

Comments

@calebsyring
Copy link
Contributor

Flask documentation says that you should use the test client as a context manager for accessing values in the session after a request. Trying to do that currently results in an error because AuthTestApp does not define __enter__. session_transaction still works and can be used as a workaround.

@rsyring
Copy link
Member

rsyring commented Aug 23, 2023

Keg uses WebTest by way of Flask-WebTest. Flask docs related to testing assume the use of Flask's Client and therefore don't usually apply to any of our testing scenarios in the Keg ecosystem.

WebTest and Flask's Client are for the same purpose but have different implementations and request/response objects.

It could still be useful to use the app as a context manager, just want to make sure the distinction between Client and WebTest is remembered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants