diff --git a/tests/async_tests/test_interfaces.py b/tests/async_tests/test_interfaces.py index ac2483254..814647900 100644 --- a/tests/async_tests/test_interfaces.py +++ b/tests/async_tests/test_interfaces.py @@ -1,5 +1,4 @@ import platform -import sys import pytest @@ -467,41 +466,3 @@ async def test_cannot_connect_uds(backend: str) -> None: async with httpcore.AsyncConnectionPool(backend=backend, uds=uds) as http: with pytest.raises(httpcore.ConnectError): await http.arequest(method, url) - - -@pytest.mark.skipif( - sys.version_info[:2] < (3, 7), - reason="Hypercorn doesn't support python < 3.7 (this test is local-only)", -) -@pytest.mark.anyio -async def test_connection_timeout_tcp(backend: str, server: Server) -> None: - # we try to access http server using https. It caused some SSL timeouts - # in TLSStream.wrap inside inside AnyIOBackend.open_tcp_stream - method = b"GET" - url = (b"https", *server.netloc, b"/") - headers = [server.host_header] - ext = {"timeout": {"connect": 0.1}} - - async with httpcore.AsyncConnectionPool(backend=backend) as http: - with pytest.raises(httpcore.ConnectTimeout): - await http.arequest(method, url, headers, ext=ext) - - -@pytest.mark.skipif( - sys.version_info[:2] < (3, 7), - reason="Hypercorn doesn't support python < 3.7 (this test is local-only)", -) -@pytest.mark.anyio -async def test_connection_timeout_uds( - backend: str, uds_server: Server, uds: str -) -> None: - # we try to access http server using https. It caused some SSL timeouts - # in TLSStream.wrap inside AnyIOBackend.open_uds_stream - method = b"GET" - url = (b"https", b"localhost", None, b"/") - headers = [(b"host", b"localhost")] - ext = {"timeout": {"connect": 0.1}} - - async with httpcore.AsyncConnectionPool(uds=uds, backend=backend) as http: - with pytest.raises(httpcore.ConnectTimeout): - await http.arequest(method, url, headers, ext=ext) diff --git a/tests/sync_tests/test_interfaces.py b/tests/sync_tests/test_interfaces.py index e1db92c87..dade26b9e 100644 --- a/tests/sync_tests/test_interfaces.py +++ b/tests/sync_tests/test_interfaces.py @@ -1,5 +1,4 @@ import platform -import sys import pytest @@ -467,41 +466,3 @@ def test_cannot_connect_uds(backend: str) -> None: with httpcore.SyncConnectionPool(backend=backend, uds=uds) as http: with pytest.raises(httpcore.ConnectError): http.request(method, url) - - -@pytest.mark.skipif( - sys.version_info[:2] < (3, 7), - reason="Hypercorn doesn't support python < 3.7 (this test is local-only)", -) - -def test_connection_timeout_tcp(backend: str, server: Server) -> None: - # we try to access http server using https. It caused some SSL timeouts - # in TLSStream.wrap inside inside AnyIOBackend.open_tcp_stream - method = b"GET" - url = (b"https", *server.netloc, b"/") - headers = [server.host_header] - ext = {"timeout": {"connect": 0.1}} - - with httpcore.SyncConnectionPool(backend=backend) as http: - with pytest.raises(httpcore.ConnectTimeout): - http.request(method, url, headers, ext=ext) - - -@pytest.mark.skipif( - sys.version_info[:2] < (3, 7), - reason="Hypercorn doesn't support python < 3.7 (this test is local-only)", -) - -def test_connection_timeout_uds( - backend: str, uds_server: Server, uds: str -) -> None: - # we try to access http server using https. It caused some SSL timeouts - # in TLSStream.wrap inside AnyIOBackend.open_uds_stream - method = b"GET" - url = (b"https", b"localhost", None, b"/") - headers = [(b"host", b"localhost")] - ext = {"timeout": {"connect": 0.1}} - - with httpcore.SyncConnectionPool(uds=uds, backend=backend) as http: - with pytest.raises(httpcore.ConnectTimeout): - http.request(method, url, headers, ext=ext)