Fix pylint errors.

This commit is contained in:
Imran Sobir 2017-02-28 19:49:00 +05:00
parent 9e6b0240f6
commit cb6c6b814e
2 changed files with 6 additions and 4 deletions

View File

@ -29,7 +29,7 @@ import sys
import time import time
import urllib.parse import urllib.parse
from PyQt5.QtCore import QUrl, QUrlQuery from PyQt5.QtCore import QUrlQuery
import qutebrowser import qutebrowser
from qutebrowser.utils import (version, utils, jinja, log, message, docutils, from qutebrowser.utils import (version, utils, jinja, log, message, docutils,
@ -203,7 +203,7 @@ def qute_history(url):
if item_newer: if item_newer:
continue continue
else: else:
# history_dict is not reversed, we are going forward in history. # history_dict isn't reversed, we are going forward in history.
# so: # so:
# abort if item is newer than start_time # abort if item is newer than start_time
# skip if item is older than start_time+24hrs # skip if item is older than start_time+24hrs

View File

@ -42,7 +42,7 @@ class TestJavascriptHandler:
def patch_read_file(self, monkeypatch): def patch_read_file(self, monkeypatch):
"""Patch utils.read_file to return few fake JS files.""" """Patch utils.read_file to return few fake JS files."""
def _read_file(path, binary=False): def _read_file(path, binary=False):
"""Faked utils.read_file""" """Faked utils.read_file."""
assert not binary assert not binary
for filename, content in self.js_files: for filename, content in self.js_files:
if path == os.path.join('javascript', filename): if path == os.path.join('javascript', filename):
@ -75,13 +75,15 @@ class TestHistoryHandler:
"""Test the qute://history endpoint.""" """Test the qute://history endpoint."""
# Current time
now = time.time()
@pytest.fixture @pytest.fixture
def entries(self): def entries(self):
"""Create fake history entries.""" """Create fake history entries."""
# create 12 history items spaced 6 hours apart, starting from now # create 12 history items spaced 6 hours apart, starting from now
entry_count = 12 entry_count = 12
interval = 6 * 60 * 60 interval = 6 * 60 * 60
self.now = time.time()
items = [] items = []
for i in range(entry_count): for i in range(entry_count):