Feature request #3445.

This commit is contained in:
raymond-devries 2020-02-10 11:50:48 -08:00
parent 5ceb0a59dd
commit 900fa2f795
2 changed files with 3 additions and 2 deletions

View file

@ -2078,9 +2078,9 @@ class Flask(_PackageBoundObject):
# the body must not be None
if rv is None:
raise TypeError(
"The view function did not return a valid response. The"
'The view function for "{}" did not return a valid response. The'
" function either returned None or ended without a return"
" statement."
" statement.".format(request.endpoint)
)
# make sure the body is an instance of the response class

View file

@ -1221,6 +1221,7 @@ def test_response_type_errors():
with pytest.raises(TypeError) as e:
c.get("/none")
assert "returned None" in str(e.value)
assert "from_none" in str(e.value)
with pytest.raises(TypeError) as e:
c.get("/small_tuple")