Fix Timeout -> TimeoutException in test case (#598)

This commit is contained in:
Tom Christie 2019-12-05 11:03:27 +00:00 committed by GitHub
parent f8794cb3ce
commit dad379736d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ import h2.events
import pytest
from h2.settings import SettingCodes
from httpx import Client, Response, Timeout
from httpx import Client, Response, TimeoutException
from .utils import MockHTTP2Backend
@ -142,7 +142,7 @@ async def test_http2_live_request(backend):
async with Client(backend=backend, http2=True) as client:
try:
resp = await client.get("https://nghttp2.org/httpbin/anything")
except Timeout:
except TimeoutException:
pytest.xfail(reason="nghttp2.org appears to be unresponsive")
except socket.gaierror:
pytest.xfail(reason="You appear to be offline")