Skip to content

Instantly share code, notes, and snippets.

@geier
Last active February 15, 2018 22:03
Show Gist options
  • Save geier/6c499eae6a5b957dbf1e6de8b64df62f to your computer and use it in GitHub Desktop.
Save geier/6c499eae6a5b957dbf1e6de8b64df62f to your computer and use it in GitHub Desktop.
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
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