From 3a4ef09f58312b3bc614150950ad662ebf92f2dd Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Thu, 8 Jun 2017 07:34:35 -0400 Subject: [PATCH] More sql code review fixes --- qutebrowser/completion/completionwidget.py | 4 ++-- tests/end2end/features/test_history_bdd.py | 4 ++-- tests/unit/browser/webkit/test_history.py | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index f4d4d80b7..15f317c5a 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -149,7 +149,7 @@ class CompletionView(QTreeView): def _resize_columns(self): """Resize the completion columns based on column_widths.""" width = self.size().width() - column_widths = self.model.column_widths + column_widths = self.model().column_widths pixel_widths = [(width * perc // 100) for perc in column_widths] if self.verticalScrollBar().isVisible(): @@ -295,7 +295,7 @@ class CompletionView(QTreeView): def _maybe_show(self): if (config.get('completion', 'show') == 'always' and - model.count() > 0): + self.model().count() > 0): self.show() else: self.hide() diff --git a/tests/end2end/features/test_history_bdd.py b/tests/end2end/features/test_history_bdd.py index 5249e891c..75f20efcb 100644 --- a/tests/end2end/features/test_history_bdd.py +++ b/tests/end2end/features/test_history_bdd.py @@ -44,5 +44,5 @@ def check_history(quteproc, httpbin, tmpdir, expected): @bdd.then("the history should be empty") -def check_history_empty(quteproc, httpbin): - check_history(quteproc, '', httpbin) +def check_history_empty(quteproc, httpbin, tmpdir): + check_history(quteproc, httpbin, tmpdir, '') diff --git a/tests/unit/browser/webkit/test_history.py b/tests/unit/browser/webkit/test_history.py index 841da4ea7..49b499534 100644 --- a/tests/unit/browser/webkit/test_history.py +++ b/tests/unit/browser/webkit/test_history.py @@ -107,7 +107,6 @@ def test_entries_before(hist): assert times == [12348, 12347, 12346] - def test_clear(qtbot, tmpdir, hist, mocker): hist.add_url(QUrl('http://example.com/')) hist.add_url(QUrl('http://www.qutebrowser.org/')) @@ -186,7 +185,7 @@ def cleanup_init(): try: from PyQt5.QtWebKit import QWebHistoryInterface QWebHistoryInterface.setDefaultInterface(None) - except Exception: + except ImportError: pass