Fix lint
This commit is contained in:
parent
9edc5a665e
commit
387e35d3e5
@ -80,7 +80,8 @@ def render(template, **kwargs):
|
||||
return _env.get_template(template).render(**kwargs)
|
||||
except jinja2.exceptions.UndefinedError:
|
||||
log.misc.exception("UndefinedError while rendering " + template)
|
||||
err_template = utils.read_file(os.path.join('html', 'undef_error.html'))
|
||||
err_path = os.path.join('html', 'undef_error.html')
|
||||
err_template = utils.read_file(err_path)
|
||||
tb = traceback.format_exc()
|
||||
return err_template.format(pagename=template, traceback=tb)
|
||||
|
||||
|
@ -34,6 +34,7 @@ from qutebrowser.utils import utils, jinja
|
||||
def patch_read_file(monkeypatch):
|
||||
"""pytest fixture to patch utils.read_file."""
|
||||
real_read_file = utils.read_file
|
||||
|
||||
def _read_file(path):
|
||||
"""A read_file which returns a simple template if the path is right."""
|
||||
if path == os.path.join('html', 'test.html'):
|
||||
|
Loading…
Reference in New Issue
Block a user