Home / Function/ test_greenlet_context_copying_api() — flask Function Reference

test_greenlet_context_copying_api() — flask Function Reference

Architecture documentation for the test_greenlet_context_copying_api() function in test_reqctx.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  b11af580_8689_b9bf_e560_3798d24f4253["test_greenlet_context_copying_api()"]
  d3571f99_30e7_c391_939e_411db4c2011d["TestGreenletContextCopying"]
  b11af580_8689_b9bf_e560_3798d24f4253 -->|defined in| d3571f99_30e7_c391_939e_411db4c2011d
  1096b6f8_f181_c055_be79_b7cbb61e997b["greenlet()"]
  b11af580_8689_b9bf_e560_3798d24f4253 -->|calls| 1096b6f8_f181_c055_be79_b7cbb61e997b
  style b11af580_8689_b9bf_e560_3798d24f4253 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_reqctx.py lines 179–202

    def test_greenlet_context_copying_api(self, app, client):
        greenlets = []

        @app.route("/")
        def index():
            flask.session["fizz"] = "buzz"

            @flask.copy_current_request_context
            def g():
                assert flask.request
                assert flask.current_app == app
                assert flask.request.path == "/"
                assert flask.request.args["foo"] == "bar"
                assert flask.session.get("fizz") == "buzz"
                return 42

            greenlets.append(greenlet(g))
            return "Hello World!"

        rv = client.get("/?foo=bar")
        assert rv.data == b"Hello World!"

        result = greenlets[0].run()
        assert result == 42

Subdomains

Calls

Frequently Asked Questions

What does test_greenlet_context_copying_api() do?
test_greenlet_context_copying_api() is a function in the flask codebase, defined in tests/test_reqctx.py.
Where is test_greenlet_context_copying_api() defined?
test_greenlet_context_copying_api() is defined in tests/test_reqctx.py at line 179.
What does test_greenlet_context_copying_api() call?
test_greenlet_context_copying_api() calls 1 function(s): greenlet.

Analyze Your Own Codebase

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

Try Supermodel Free