(self, mock_socket)
| 2114 | |
| 2115 | @patch('socket.socket') |
| 2116 | def test_tcp_timeout(self, mock_socket): |
| 2117 | instance_mock_sock = mock_socket.return_value |
| 2118 | instance_mock_sock.connect.side_effect = socket.timeout |
| 2119 | |
| 2120 | with self.assertRaises(socket.timeout): |
| 2121 | logging.handlers.SysLogHandler(address=('localhost', 514), |
| 2122 | socktype=socket.SOCK_STREAM, |
| 2123 | timeout=1) |
| 2124 | |
| 2125 | instance_mock_sock.close.assert_called() |
| 2126 | |
| 2127 | @unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required") |
| 2128 | class UnixSysLogHandlerTest(SysLogHandlerTest): |
nothing calls this directly
no test coverage detected