Last active
February 15, 2018 22:03
-
-
Save geier/6c499eae6a5b957dbf1e6de8b64df62f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from totest import function | |
import logging | |
import click_log | |
def test_function(caplog): | |
click_log.basic_config('test').setLevel(logging.DEBUG) | |
caplog.set_level(logging.WARNING) | |
assert 1 == function() | |
assert caplog.records == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import click_log | |
logger = logging.getLogger('test') | |
click_log.basic_config('test').setLevel(logging.DEBUG) | |
def function(): | |
logger.warning('this is a warning') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment