MCPcopy
hub / github.com/urllib3/urllib3 / test_dnsresolver_forced_error

Method test_dnsresolver_forced_error

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

Source from the content-addressed store, hash-verified

887
888 @patch("socket.getaddrinfo")
889 def test_dnsresolver_forced_error(self, getaddrinfo: MagicMock) -> None:
890 getaddrinfo.side_effect = socket.gaierror()
891 with pytest.raises(socket.gaierror):
892 # dns is valid but we force the error just for the sake of the test
893 create_connection(("example.com", 80))
894
895 def test_dnsresolver_expected_error(self) -> None:
896 with pytest.raises(socket.gaierror):

Callers

nothing calls this directly

Calls 1

create_connectionFunction · 0.90

Tested by

no test coverage detected