Skip to content
Myr

Ensure that nobody can nest test client invocations

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent f051939 · Browse files · 1 file+2 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−0 removed

  • other:+2 added−0 removed

1 file+2 added−0 removed

modified:flask/testing.py+2 added
106 unmodified lines
107 finally:108 self.context_preserved = _request_ctx_stack.top is not old109110 def __enter__(self):111 if self.preserve_context:112 raise RuntimeError('Cannot nest client invocations')113 self.preserve_context = True114 return self115116 def __exit__(self, exc_type, exc_value, tb):
3 unmodified lines