From e78d2a83993941198ddc24564ae862d44a2dd46e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 17 Dec 2015 07:43:57 +0100 Subject: [PATCH] tests: Check args for loadFinished signals. --- tests/unit/browser/test_webelem.py | 3 ++- tests/unit/javascript/conftest.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/unit/browser/test_webelem.py b/tests/unit/browser/test_webelem.py index 911e88228..02b9e555d 100644 --- a/tests/unit/browser/test_webelem.py +++ b/tests/unit/browser/test_webelem.py @@ -628,8 +628,9 @@ class TestJavascriptEscape: with open(path, encoding='utf-8') as f: html_source = f.read().replace('%INPUT%', escaped) - with qtbot.waitSignal(webframe.loadFinished, raising=True): + with qtbot.waitSignal(webframe.loadFinished, raising=True) as blocker: webframe.setHtml(html_source) + assert blocker.args == [True] result = webframe.evaluateJavaScript('window.qute_test_result') assert result is not None diff --git a/tests/unit/javascript/conftest.py b/tests/unit/javascript/conftest.py index 1b9e702c7..e620b4c55 100644 --- a/tests/unit/javascript/conftest.py +++ b/tests/unit/javascript/conftest.py @@ -94,8 +94,10 @@ class JSTester: **kwargs: Passed to jinja's template.render(). """ template = self._jinja_env.get_template(path) - with self._qtbot.waitSignal(self.webview.loadFinished, raising=True): + with self._qtbot.waitSignal(self.webview.loadFinished, + raising=True) as blocker: self.webview.setHtml(template.render(**kwargs)) + assert blocker.args == [True] def run_file(self, filename): """Run a javascript file.