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():