forked from orbit-oss/flask
Merge branch '1.0.x'
This commit is contained in:
commit
b05a685a03
6 changed files with 59 additions and 28 deletions
|
|
@ -1220,21 +1220,17 @@ def test_response_type_errors():
|
|||
|
||||
with pytest.raises(TypeError) as e:
|
||||
c.get("/none")
|
||||
|
||||
assert "returned None" in str(e)
|
||||
assert "returned None" in str(e.value)
|
||||
|
||||
with pytest.raises(TypeError) as e:
|
||||
c.get("/small_tuple")
|
||||
|
||||
assert "tuple must have the form" in str(e)
|
||||
assert "tuple must have the form" in str(e.value)
|
||||
|
||||
pytest.raises(TypeError, c.get, "/large_tuple")
|
||||
|
||||
with pytest.raises(TypeError) as e:
|
||||
c.get("/bad_type")
|
||||
|
||||
assert "object is not callable" not in str(e)
|
||||
assert "it was a bool" in str(e)
|
||||
assert "it was a bool" in str(e.value)
|
||||
|
||||
pytest.raises(TypeError, c.get, "/bad_wsgi")
|
||||
|
||||
|
|
@ -1636,7 +1632,7 @@ def test_debug_mode_complains_after_first_request(app, client):
|
|||
def broken():
|
||||
return "Meh"
|
||||
|
||||
assert "A setup function was called" in str(e)
|
||||
assert "A setup function was called" in str(e.value)
|
||||
|
||||
app.debug = False
|
||||
|
||||
|
|
@ -1691,8 +1687,10 @@ def test_routing_redirect_debugging(app, client):
|
|||
with client:
|
||||
with pytest.raises(AssertionError) as e:
|
||||
client.post("/foo", data={})
|
||||
assert "http://localhost/foo/" in str(e)
|
||||
assert ("Make sure to directly send your POST-request to this URL") in str(e)
|
||||
assert "http://localhost/foo/" in str(e.value)
|
||||
assert ("Make sure to directly send your POST-request to this URL") in str(
|
||||
e.value
|
||||
)
|
||||
|
||||
rv = client.get("/foo", data={}, follow_redirects=True)
|
||||
assert rv.data == b"success"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue