MCPcopy
hub / github.com/urllib3/urllib3 / test_create_connection_error

Method test_create_connection_error

test/test_util.py:883–886  ·  view source on GitHub ↗
(self, getaddrinfo: MagicMock)

Source from the content-addressed store, hash-verified

881
882 @patch("socket.getaddrinfo")
883 def test_create_connection_error(self, getaddrinfo: MagicMock) -> None:
884 getaddrinfo.return_value = []
885 with pytest.raises(OSError, match="getaddrinfo returns an empty list"):
886 create_connection(("example.com", 80))
887
888 @patch("socket.getaddrinfo")
889 def test_dnsresolver_forced_error(self, getaddrinfo: MagicMock) -> None:

Callers

nothing calls this directly

Calls 1

create_connectionFunction · 0.90

Tested by

no test coverage detected