MCPcopy
hub / github.com/pallets/werkzeug / test_lazy_start_response_empty_response_app

Function test_lazy_start_response_empty_response_app

tests/test_test.py:711–728  ·  view source on GitHub ↗
(buffered, iterable)

Source from the content-addressed store, hash-verified

709@pytest.mark.parametrize("buffered", (True, False))
710@pytest.mark.parametrize("iterable", (True, False))
711def test_lazy_start_response_empty_response_app(buffered, iterable):
712 class app:
713 def __init__(self, environ, start_response):
714 self.start_response = start_response
715
716 def __iter__(self):
717 return self
718
719 def __next__(self):
720 self.start_response("200 OK", [("Content-Type", "text/html")])
721 raise StopIteration
722
723 if iterable:
724 app = iterable_middleware(app)
725 app_iter, status, headers = run_wsgi_app(app, {}, buffered=buffered)
726 assert status == "200 OK"
727 assert list(headers) == [("Content-Type", "text/html")]
728 assert "".join(app_iter) == ""
729
730
731def test_run_wsgi_app_closing_iterator():

Callers

nothing calls this directly

Calls 3

run_wsgi_appFunction · 0.90
iterable_middlewareFunction · 0.85
listFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…