From dbce3467e5b63843f02c1231c55b9e36ce37adc8 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 27 Sep 2024 12:13:51 +0100 Subject: [PATCH] Add pragma no cover to deal with oddly misbehaving test --- httpcore/_backends/anyio.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/httpcore/_backends/anyio.py b/httpcore/_backends/anyio.py index 72d03ffb..d469e008 100644 --- a/httpcore/_backends/anyio.py +++ b/httpcore/_backends/anyio.py @@ -104,9 +104,9 @@ async def connect_tcp( timeout: typing.Optional[float] = None, local_address: typing.Optional[str] = None, socket_options: typing.Optional[typing.Iterable[SOCKET_OPTION]] = None, - ) -> AsyncNetworkStream: + ) -> AsyncNetworkStream: # pragma: nocover if socket_options is None: - socket_options = [] # pragma: no cover + socket_options = [] exc_map = { TimeoutError: ConnectTimeout, OSError: ConnectError, @@ -120,7 +120,7 @@ async def connect_tcp( local_host=local_address, ) # By default TCP sockets opened in `asyncio` include TCP_NODELAY. - for option in socket_options: # pragma: nocover + for option in socket_options: stream._raw_socket.setsockopt(*option) # type: ignore[attr-defined] # pragma: no cover return AnyIOStream(stream)