push preserved contexts in correct order
This commit is contained in:
parent
5addaf833b
commit
53b8f08218
3 changed files with 15 additions and 23 deletions
|
|
@ -240,10 +240,10 @@ class FlaskClient(Client):
|
|||
response.json_module = self.application.json # type: ignore[assignment]
|
||||
|
||||
# Re-push contexts that were preserved during the request.
|
||||
while self._new_contexts:
|
||||
cm = self._new_contexts.pop()
|
||||
for cm in self._new_contexts:
|
||||
self._context_stack.enter_context(cm)
|
||||
|
||||
self._new_contexts.clear()
|
||||
return response
|
||||
|
||||
def __enter__(self) -> FlaskClient:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue