diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 3cb3ee89a..f4e5d1486 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -778,7 +778,7 @@ class QuteProc(testprocess.Process): data = f.read() self._log('\nCurrent session data:\n' + data) - return yaml.load(data) + return utils.yaml_load(data) def get_content(self, plain=True): """Get the contents of the current page.""" diff --git a/tests/end2end/test_hints_html.py b/tests/end2end/test_hints_html.py index 9dee23c53..65502c7b7 100644 --- a/tests/end2end/test_hints_html.py +++ b/tests/end2end/test_hints_html.py @@ -24,10 +24,11 @@ import os.path import textwrap import attr -import yaml import pytest import bs4 +from qutebrowser.utils import utils + def collect_tests(): basedir = os.path.dirname(__file__) @@ -58,12 +59,13 @@ def _parse_file(test_name): with open(file_path, 'r', encoding='utf-8') as html: soup = bs4.BeautifulSoup(html, 'html.parser') - comment = soup.find(text=lambda text: isinstance(text, bs4.Comment)) + comment = str(soup.find(text=lambda text: isinstance(text, bs4.Comment))) if comment is None: raise InvalidFile(test_name, "no comment found") - data = yaml.load(comment) + data = utils.yaml_load(comment) + if not isinstance(data, dict): raise InvalidFile(test_name, "expected yaml dict but got {}".format( type(data).__name__))