Feature request #3445.
This commit is contained in:
parent
5ceb0a59dd
commit
900fa2f795
2 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue