Commit dbeb2746 authored by Vinay Sajip's avatar Vinay Sajip

test_logging: handle syslogd connection failure.

parent 5a35b06d
...@@ -531,10 +531,13 @@ class HandlerTest(BaseTest): ...@@ -531,10 +531,13 @@ class HandlerTest(BaseTest):
sockname = '/var/run/log' sockname = '/var/run/log'
else: else:
sockname = '/dev/log' sockname = '/dev/log'
h = logging.handlers.SysLogHandler(sockname) try:
self.assertEqual(h.facility, h.LOG_USER) h = logging.handlers.SysLogHandler(sockname)
self.assertTrue(h.unixsocket) self.assertEqual(h.facility, h.LOG_USER)
h.close() self.assertTrue(h.unixsocket)
h.close()
except socket.error: # syslogd might not be available
pass
h = logging.handlers.SMTPHandler('localhost', 'me', 'you', 'Log') h = logging.handlers.SMTPHandler('localhost', 'me', 'you', 'Log')
self.assertEqual(h.toaddrs, ['you']) self.assertEqual(h.toaddrs, ['you'])
h.close() h.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment