(self, getaddrinfo: MagicMock)
| 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): |
nothing calls this directly
no test coverage detected