From 6f195233f5d86a4d79c12259d8a9eb760b369160 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Sat, 25 Aug 2012 01:38:33 -0400 Subject: [PATCH] Applies PEP-8 recommendations. Whitespace wrangling. --- tests/test_logger.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/test_logger.py b/tests/test_logger.py index 5a9b8e31..7a2ae780 100644 --- a/tests/test_logger.py +++ b/tests/test_logger.py @@ -13,23 +13,21 @@ from zipline.utils.test_utils import create_receiver, drain_receiver from unittest2 import TestCase - class LoggerTestCase(TestCase): def setUp(self): - configure_logging() - self.LOG = logging.getLogger("ZiplineLogger") + configure_logging() + self.LOG = logging.getLogger("ZiplineLogger") def test_log(self): test_msg = uuid.uuid1().hex self.LOG.info(test_msg) - logfile = open('/var/log/zipline/zipline.log','r') + logfile = open('/var/log/zipline/zipline.log', 'r') with logfile: last_line = tail(logfile, window=1) logged_msg = last_line.split(" - ")[1] self.assertEqual(test_msg, logged_msg) - def test_zmq_handler(self): socket_addr = 'tcp://127.0.0.1:10000' ctx = zmq.Context() @@ -37,8 +35,8 @@ class LoggerTestCase(TestCase): socket_push.connect(socket_addr) recv = create_receiver(socket_addr, ctx) zmq_out = ZeroMQLogHandler( - socket = socket_push, - filter = lambda r, h: r.channel in ['test zmq logger'], + socket=socket_push, + filter=lambda r, h: r.channel in ['test zmq logger'], context=ctx, #bubble=False ) @@ -50,7 +48,6 @@ class LoggerTestCase(TestCase): with zmq_out.threadbound(): log.info(ex.num) - output, _ = drain_receiver(recv, count=1) self.assertEqual(output[-1]['prefix'], 'LOG') self.assertTrue(isinstance(output[-1]['payload']['msg'], basestring))