mirror of https://github.com/tiangolo/fastapi.git
Clean up tests
This commit is contained in:
parent
16d138113e
commit
6fc5f688ec
|
|
@ -98,15 +98,20 @@ def test_request_validation_error_includes_endpoint_context():
|
|||
|
||||
|
||||
def test_response_validation_error_includes_endpoint_context():
|
||||
captured_exception.exception = None
|
||||
try:
|
||||
client.get("/items/")
|
||||
except ResponseValidationError as exc:
|
||||
error_str = str(exc)
|
||||
assert "get_item" in error_str
|
||||
assert "/items/" in error_str
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
assert captured_exception.exception is not None
|
||||
error_str = str(captured_exception.exception)
|
||||
assert "get_item" in error_str
|
||||
assert "/items/" in error_str
|
||||
|
||||
|
||||
def test_websocket_validation_error_includes_endpoint_context():
|
||||
captured_exception.exception = None
|
||||
try:
|
||||
with client.websocket_connect("/ws/invalid"):
|
||||
pass # pragma: no cover
|
||||
|
|
|
|||
Loading…
Reference in New Issue