Fix lint and tests

This commit is contained in:
Florian Bruhin 2018-09-06 22:06:56 +02:00
parent 2dccde8f4b
commit 24148c649e
6 changed files with 3 additions and 16 deletions

View File

@ -241,7 +241,6 @@ class FileDownloadTarget(_DownloadTarget):
""" """
def __init__(self, filename, force_overwrite=False): def __init__(self, filename, force_overwrite=False):
# pylint: disable=super-init-not-called
self.filename = filename self.filename = filename
self.force_overwrite = force_overwrite self.force_overwrite = force_overwrite
@ -261,7 +260,6 @@ class FileObjDownloadTarget(_DownloadTarget):
""" """
def __init__(self, fileobj): def __init__(self, fileobj):
# pylint: disable=super-init-not-called
self.fileobj = fileobj self.fileobj = fileobj
def suggested_filename(self): def suggested_filename(self):
@ -288,7 +286,6 @@ class OpenFileDownloadTarget(_DownloadTarget):
""" """
def __init__(self, cmdline=None): def __init__(self, cmdline=None):
# pylint: disable=super-init-not-called
self.cmdline = cmdline self.cmdline = cmdline
def suggested_filename(self): def suggested_filename(self):
@ -776,8 +773,8 @@ class AbstractDownloadItem(QObject):
return return
if isinstance(target, OpenFileDownloadTarget): if isinstance(target, OpenFileDownloadTarget):
self.finished.connect( self.finished.connect(functools.partial(
functools.partial(self._open_if_successful, target.cmdline)) self._open_if_successful, target.cmdline))
elif isinstance(target, PDFJSDownloadTarget): elif isinstance(target, PDFJSDownloadTarget):
self.finished.connect(self._pdfjs_if_successful) self.finished.connect(self._pdfjs_if_successful)
else: else:

View File

@ -48,7 +48,6 @@ from qutebrowser.browser import pdfjs
from qutebrowser.config import config, configdata, configexc, configdiff from qutebrowser.config import config, configdata, configexc, configdiff
from qutebrowser.utils import (version, utils, jinja, log, message, docutils, from qutebrowser.utils import (version, utils, jinja, log, message, docutils,
objreg, urlutils) objreg, urlutils)
from qutebrowser.misc import objects
from qutebrowser.qt import sip from qutebrowser.qt import sip

View File

@ -225,7 +225,6 @@ class DownloadManager(downloads.AbstractDownloadManager):
download.set_target(downloads.PDFJSDownloadTarget()) download.set_target(downloads.PDFJSDownloadTarget())
return return
filename = downloads.immediate_download_path() filename = downloads.immediate_download_path()
if filename is not None: if filename is not None:
# User doesn't want to be asked, so just use the download_dir # User doesn't want to be asked, so just use the download_dir

View File

@ -19,14 +19,12 @@
"""QtWebKit specific qute://* handlers and glue code.""" """QtWebKit specific qute://* handlers and glue code."""
import mimetypes
from PyQt5.QtCore import QUrl from PyQt5.QtCore import QUrl
from PyQt5.QtNetwork import QNetworkReply, QNetworkAccessManager from PyQt5.QtNetwork import QNetworkReply, QNetworkAccessManager
from qutebrowser.browser import qutescheme from qutebrowser.browser import qutescheme
from qutebrowser.browser.webkit.network import networkreply from qutebrowser.browser.webkit.network import networkreply
from qutebrowser.utils import log, usertypes, qtutils from qutebrowser.utils import log, qtutils
def handler(request, operation, current_url): def handler(request, operation, current_url):

View File

@ -17,8 +17,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>. # along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
import textwrap
import pytest import pytest
from PyQt5.QtCore import QUrl from PyQt5.QtCore import QUrl

View File

@ -68,10 +68,6 @@ def test_page_titles(url, title, out):
class TestDownloadTarget: class TestDownloadTarget:
def test_base(self):
with pytest.raises(NotImplementedError):
downloads._DownloadTarget()
def test_filename(self): def test_filename(self):
target = downloads.FileDownloadTarget("/foo/bar") target = downloads.FileDownloadTarget("/foo/bar")
assert target.filename == "/foo/bar" assert target.filename == "/foo/bar"