diff options
author | Dana Powers <dana.powers@rd.io> | 2015-06-09 20:25:13 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@rd.io> | 2015-06-09 20:27:09 -0700 |
commit | fc30855953f3dfd46a80e65e17283102085392e5 (patch) | |
tree | af7abe5d74d1378a6c77b1c0e012ce2be078b316 | |
parent | f035de49da2b4d7205e746c99e729c0810285e89 (diff) | |
download | kafka-python-fc30855953f3dfd46a80e65e17283102085392e5.tar.gz |
Reset kafka.conn logger level in tearDown
-rw-r--r-- | test/test_conn.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_conn.py b/test/test_conn.py index 6e47cc8..2b70344 100644 --- a/test/test_conn.py +++ b/test/test_conn.py @@ -50,6 +50,11 @@ class ConnTest(unittest.TestCase): # Reset any mock counts caused by __init__ self.MockCreateConn.reset_mock() + def tearDown(self): + # Return connection logging to INFO + logging.getLogger('kafka.conn').setLevel(logging.INFO) + + def test_collect_hosts__happy_path(self): hosts = "localhost:1234,localhost" results = collect_hosts(hosts) @@ -172,6 +177,14 @@ class ConnTest(unittest.TestCase): class TestKafkaConnection(unittest.TestCase): + def setUp(self): + # kafka.conn debug logging is verbose, so only enable in conn tests + logging.getLogger('kafka.conn').setLevel(logging.DEBUG) + + def tearDown(self): + # Return connection logging to INFO + logging.getLogger('kafka.conn').setLevel(logging.INFO) + @mock.patch('socket.create_connection') def test_copy(self, socket): """KafkaConnection copies work as expected""" |