From 87969fb3f57e84ee070a90ea03126f2aba069ce3 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Mon, 20 Mar 2017 00:56:03 +0000 Subject: tests: Update `TestMDLSLogger.test_debug` * tests/test_markdown_link_style/test_logging.py (TestMDLSLogger.test_debug) (TestMDLSLogger.setup): Update methods. --- tests/test_markdown_link_style/test_logging.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_markdown_link_style/test_logging.py b/tests/test_markdown_link_style/test_logging.py index cf43768..6478192 100644 --- a/tests/test_markdown_link_style/test_logging.py +++ b/tests/test_markdown_link_style/test_logging.py @@ -18,6 +18,10 @@ # along with markdown-link-style (see COPYING). If not, see # . +import sys + +from io import StringIO + from markdown_link_style.logging import MDLSLogger class TestMDLSLogger(object): @@ -26,10 +30,13 @@ class TestMDLSLogger(object): """ def setup(self): - self.logger = MDLSLogger('DebugTest') + self.stream = StringIO() + self.logger = MDLSLogger('TestLogger', self.stream) def test_debug(self): - self.logger.debug('DEBUG::MSG') + log_msg = 'DEBUG::MSG' + self.logger.debug(log_msg) + assert self.stream.getvalue().strip('\n') == log_msg def test_info(self): self.logger.info('INFO::MSG') -- cgit v1.2.3