summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2016-06-09 17:25:52 +0200
committerFlorian Bruhin <git@the-compiler.org>2016-06-09 21:14:03 +0200
commit33f01d8375285519235382260b092fa7aefc5a79 (patch)
tree56b6672cf23611e012f4d2054b0b0e230f2c1f7e
parentd5abfa3d0d20c292986e0be45d80dddb6cd0d475 (diff)
downloadqutebrowser-33f01d8375285519235382260b092fa7aefc5a79.tar.gz
qutebrowser-33f01d8375285519235382260b092fa7aefc5a79.zip
Fix lint
-rw-r--r--qutebrowser/browser/history.py4
-rw-r--r--tests/helpers/fixtures.py1
-rw-r--r--tests/unit/browser/test_cookies.py3
-rw-r--r--tests/unit/browser/test_history.py4
4 files changed, 4 insertions, 8 deletions
diff --git a/qutebrowser/browser/history.py b/qutebrowser/browser/history.py
index 5b061c1c4..2e264ffd7 100644
--- a/qutebrowser/browser/history.py
+++ b/qutebrowser/browser/history.py
@@ -68,6 +68,7 @@ class Entry:
@classmethod
def from_str(cls, line):
+ """Parse a history line like '12345 http://example.com title'."""
data = line.split(maxsplit=2)
if len(data) == 2:
atime, url = data
@@ -210,7 +211,7 @@ class WebHistory(QObject):
self._initial_read_done = True
self.async_read_done.emit()
- for url, entry in self._temp_history.items():
+ for entry in self._temp_history.values():
self._add_entry(entry)
if not entry.hidden:
self._new_history.append(entry)
@@ -272,7 +273,6 @@ class WebHistory(QObject):
self._add_entry(entry, target=self._temp_history)
-
def init(parent=None):
"""Initialize the web history.
diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py
index 21cbabc1e..847f47438 100644
--- a/tests/helpers/fixtures.py
+++ b/tests/helpers/fixtures.py
@@ -266,7 +266,6 @@ def webframe(webpage):
@pytest.fixture
def fake_keyevent_factory():
"""Fixture that when called will return a mock instance of a QKeyEvent."""
-
def fake_keyevent(key, modifiers=0, text='', typ=QEvent.KeyPress):
"""Generate a new fake QKeyPressEvent."""
evtmock = unittest.mock.create_autospec(QKeyEvent, instance=True)
diff --git a/tests/unit/browser/test_cookies.py b/tests/unit/browser/test_cookies.py
index d27d118f6..28f92ac59 100644
--- a/tests/unit/browser/test_cookies.py
+++ b/tests/unit/browser/test_cookies.py
@@ -19,14 +19,11 @@
"""Tests for qutebrowser.browser.cookies."""
-from unittest import mock
-
from PyQt5.QtNetwork import QNetworkCookie
from PyQt5.QtCore import QUrl
import pytest
from qutebrowser.browser import cookies
-from qutebrowser.utils import objreg
from qutebrowser.misc import lineparser
CONFIG_ALL_COOKIES = {'content': {'cookies-accept': 'all'}}
diff --git a/tests/unit/browser/test_history.py b/tests/unit/browser/test_history.py
index aaadc02b0..52d95f8cc 100644
--- a/tests/unit/browser/test_history.py
+++ b/tests/unit/browser/test_history.py
@@ -38,7 +38,6 @@ def test_init(hist, fake_save_manager):
def test_adding_item_during_async_read(qtbot, hist):
"""Check what happens when adding URL while reading the history."""
-
with qtbot.assertNotEmitted(hist.add_completion_item), \
qtbot.assertNotEmitted(hist.item_added):
hist.add_url(QUrl('http://www.example.com/'))
@@ -56,7 +55,8 @@ def test_adding_item_during_async_read(qtbot, hist):
def test_private_browsing(qtbot, tmpdir, fake_save_manager, config_stub):
"""Make sure no data is saved at all with private browsing."""
config_stub.data = {'general': {'private-browsing': True}}
- private_hist = history.WebHistory(hist_dir=str(tmpdir), hist_name='history')
+ private_hist = history.WebHistory(hist_dir=str(tmpdir),
+ hist_name='history')
# Before initial read
with qtbot.assertNotEmitted(private_hist.add_completion_item), \