From 8c3d461482218a8a08623b5d103d1027dc156100 Mon Sep 17 00:00:00 2001 From: Fritz Reichwald Date: Wed, 28 Dec 2016 22:35:03 +0100 Subject: [PATCH] Fix test for logging --- qutebrowser/utils/jinja.py | 4 ++-- tests/unit/utils/test_jinja.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/qutebrowser/utils/jinja.py b/qutebrowser/utils/jinja.py index e9ca30c5d..35cfebd19 100644 --- a/qutebrowser/utils/jinja.py +++ b/qutebrowser/utils/jinja.py @@ -68,8 +68,8 @@ class Loader(jinja2.BaseLoader): except OSError as e: source = html_fallback.replace("%ERROR%", html.escape(str(e))) source = source.replace("%FILE%", html.escape(template)) - log.misc.error("The {} template could not be found at {}".format( - template, path)) + log.misc.exception("The {} template could not be loaded from {}" + .format(template, path)) # Currently we don't implement auto-reloading, so we always return True # for up-to-date. return source, path, lambda: True diff --git a/tests/unit/utils/test_jinja.py b/tests/unit/utils/test_jinja.py index 155de6d78..d2f0bb7a6 100644 --- a/tests/unit/utils/test_jinja.py +++ b/tests/unit/utils/test_jinja.py @@ -111,9 +111,8 @@ def test_not_found(caplog): data = jinja.render('does_not_exist.html') assert "The does_not_exist.html template could not be found!" in data - assert len(caplog.records) == 1 assert caplog.records[0].msg.startswith("The does_not_exist.html template" - " could not be found at") + " could not be loaded from") def test_utf8():