Add a local variable for the logger name

This commit is contained in:
Raphael Pierzina 2015-04-03 20:32:29 +02:00
parent 58a8a7e992
commit 6fb83aacae

View File

@ -28,10 +28,11 @@ from qutebrowser.utils import debug
def test_log_time(caplog):
"""Test if log_time logs properly."""
logger = logging.getLogger('qt-tests')
with caplog.atLevel(logging.DEBUG, logger='qt-tests'):
with debug.log_time(logger, action='foobar'):
logger_name = 'qt-tests'
with caplog.atLevel(logging.DEBUG, logger=logger_name):
with debug.log_time(logging.getLogger(), action='foobar'):
time.sleep(0.1)
records = caplog.records()