MCPcopy Create free account
hub / github.com/pallets/quart / test_after_this_request

Function test_after_this_request

tests/test_ctx.py:72–90  ·  view source on GitHub ↗
(http_scope: HTTPScope)

Source from the content-addressed store, hash-verified

70
71
72async def test_after_this_request(http_scope: HTTPScope) -> None:
73 app = Quart(__name__)
74 headers, path, query_string = make_test_headers_path_and_query_string(app, "/")
75 async with RequestContext(
76 Quart(__name__),
77 Request(
78 "GET",
79 "http",
80 path,
81 query_string,
82 headers,
83 "",
84 "1.1",
85 http_scope,
86 send_push_promise=no_op_push,
87 ),
88 ) as context:
89 after_this_request(lambda: "hello") # type: ignore
90 assert context._after_request_functions[0]() == "hello" # type: ignore
91
92
93async def test_has_request_context(http_scope: HTTPScope) -> None:

Callers

nothing calls this directly

Calls 5

QuartClass · 0.90
RequestContextClass · 0.90
RequestClass · 0.90
after_this_requestFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…