diff options
-rw-r--r-- | tests/test_markdown_link_style/test_logging.py | 11 |
1 files 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 # <http://www.gnu.org/licenses/>. +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') |