Home / File/ test_reqctx.py — flask Source File

test_reqctx.py — flask Source File

Architecture documentation for test_reqctx.py, a python file in the flask codebase. 7 imports, 0 dependents.

File python ApplicationCore ExtensionRegistry 7 imports 13 functions 5 classes

Entity Profile

Dependency Diagram

graph LR
  aea65cbf_db83_bd4f_d83f_1a35ae104254["test_reqctx.py"]
  7dd1dda8_d340_e81e_65f0_3423e3d7e968["warnings"]
  aea65cbf_db83_bd4f_d83f_1a35ae104254 --> 7dd1dda8_d340_e81e_65f0_3423e3d7e968
  da94d511_b8b8_a450_f67f_fc28ea9b648a["pytest"]
  aea65cbf_db83_bd4f_d83f_1a35ae104254 --> da94d511_b8b8_a450_f67f_fc28ea9b648a
  8c762fc5_c0b6_0d4d_3889_896d80fbf225["flask"]
  aea65cbf_db83_bd4f_d83f_1a35ae104254 --> 8c762fc5_c0b6_0d4d_3889_896d80fbf225
  3e36f42e_6b7c_ad20_fe7e_3ce2e69941e4["flask.globals"]
  aea65cbf_db83_bd4f_d83f_1a35ae104254 --> 3e36f42e_6b7c_ad20_fe7e_3ce2e69941e4
  31623311_8417_0e4f_f6ff_2a7374d9355b["flask.sessions"]
  aea65cbf_db83_bd4f_d83f_1a35ae104254 --> 31623311_8417_0e4f_f6ff_2a7374d9355b
  2411344d_69ab_9e01_fcb6_63e2ad2dff7f["greenlet"]
  aea65cbf_db83_bd4f_d83f_1a35ae104254 --> 2411344d_69ab_9e01_fcb6_63e2ad2dff7f
  2a2a4b0c_ad5b_b59a_8848_4f7c42fd9bbe["flask.testing"]
  aea65cbf_db83_bd4f_d83f_1a35ae104254 --> 2a2a4b0c_ad5b_b59a_8848_4f7c42fd9bbe
  style aea65cbf_db83_bd4f_d83f_1a35ae104254 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import warnings

import pytest

import flask
from flask.globals import app_ctx
from flask.sessions import SecureCookieSessionInterface
from flask.sessions import SessionInterface

try:
    from greenlet import greenlet
except ImportError:
    greenlet = None


def test_teardown_on_pop(app):
    buffer = []

    @app.teardown_request
    def end_of_request(exception):
        buffer.append(exception)

    ctx = app.test_request_context()
    ctx.push()
    assert buffer == []
    ctx.pop()
    assert buffer == [None]


def test_teardown_with_previous_exception(app):
    buffer = []

    @app.teardown_request
    def end_of_request(exception):
        buffer.append(exception)

    try:
        raise Exception("dummy")
    except Exception:
        pass

    with app.test_request_context():
        assert buffer == []
    assert buffer == [None]


def test_teardown_with_handled_exception(app):
    buffer = []

    @app.teardown_request
    def end_of_request(exception):
        buffer.append(exception)

    with app.test_request_context():
        assert buffer == []
        try:
            raise Exception("dummy")
        except Exception:
            pass
    assert buffer == [None]
// ... (267 more lines)

Subdomains

Dependencies

  • flask
  • flask.globals
  • flask.sessions
  • flask.testing
  • greenlet
  • pytest
  • warnings

Frequently Asked Questions

What does test_reqctx.py do?
test_reqctx.py is a source file in the flask codebase, written in python. It belongs to the ApplicationCore domain, ExtensionRegistry subdomain.
What functions are defined in test_reqctx.py?
test_reqctx.py defines 13 function(s): greenlet, test_bad_environ_raises_bad_request, test_context_binding, test_context_test, test_environ_for_valid_idna_completes, test_manual_context_binding, test_normal_environ_completes, test_proper_test_request_context, test_session_dynamic_cookie_name, test_session_error_pops_context, and 3 more.
What does test_reqctx.py depend on?
test_reqctx.py imports 7 module(s): flask, flask.globals, flask.sessions, flask.testing, greenlet, pytest, warnings.
Where is test_reqctx.py in the architecture?
test_reqctx.py is located at tests/test_reqctx.py (domain: ApplicationCore, subdomain: ExtensionRegistry, directory: tests).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free