forked from orbit-oss/flask
Fix leak in leak detection code
If ensure_clean_request_context found a leak, it would raise an AssertionError and not clean up the leak, and therefore affect other testcases.
This commit is contained in:
parent
62e7275bdf
commit
3d36d6efb9
1 changed files with 4 additions and 1 deletions
|
|
@ -116,7 +116,10 @@ class FlaskTestCase(unittest.TestCase):
|
|||
def ensure_clean_request_context(self):
|
||||
# make sure we're not leaking a request context since we are
|
||||
# testing flask internally in debug mode in a few cases
|
||||
self.assert_equal(flask._request_ctx_stack.top, None)
|
||||
leaks = []
|
||||
while flask._request_ctx_stack.top is not None:
|
||||
leaks.append(flask._request_ctx_stack.pop())
|
||||
self.assert_equal(leaks, [])
|
||||
|
||||
def setup(self):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue