コード例 #1
0
ファイル: __init__.py プロジェクト: croach/Flask-Fixtures
def pop_ctx():
    """Removes the test context(s) from the current stack(s)
    """
    if getattr(_request_ctx_stack.top, 'fixtures_request_context', False):
        _request_ctx_stack.pop()
    if _app_ctx_stack is not None and getattr(_app_ctx_stack.top, 'fixtures_app_context', False):
        _app_ctx_stack.pop()
コード例 #2
0
def pop_ctx():
    """Removes the test context(s) from the current stack(s)
    """
    if getattr(_request_ctx_stack.top, 'fixtures_request_context', False):
        _request_ctx_stack.pop()
    if _app_ctx_stack is not None and getattr(_app_ctx_stack.top, 'fixtures_app_context', False):
        _app_ctx_stack.pop()
コード例 #3
0
 def pop(self, exc=_sentinel):
     try:
         self._refcnt -= 1
         if self._refcnt <= 0:
             if exc is _sentinel:
                 exc = sys.exc_info()[1]
             self.app.do_teardown_appcontext(exc)
     finally:
         rv = _app_ctx_stack.pop()
     assert rv is self, "Popped wrong app context.  (%r instead of %r)" % (rv, self)
     appcontext_popped.send(self.app)
コード例 #4
0
 def job_finished(*args, job=None, **kwargs):
     _app_ctx_stack.pop()