diff --git a/qutebrowser/browser/webkit/downloads.py b/qutebrowser/browser/webkit/downloads.py index ccabdae59..cc1fb6e4a 100644 --- a/qutebrowser/browser/webkit/downloads.py +++ b/qutebrowser/browser/webkit/downloads.py @@ -31,7 +31,7 @@ import collections import sip from PyQt5.QtCore import (pyqtSlot, pyqtSignal, QObject, QTimer, - Qt, QVariant, QAbstractListModel, QModelIndex, QUrl) + Qt, QAbstractListModel, QModelIndex, QUrl) from PyQt5.QtGui import QDesktopServices from PyQt5.QtNetwork import QNetworkRequest, QNetworkReply @@ -384,7 +384,8 @@ class DownloadItem(QObject): q.text = msg q.mode = usertypes.PromptMode.yesno q.answered_yes.connect(self._create_fileobj) - q.answered_no.connect(functools.partial(self.cancel, remove_data=False)) + q.answered_no.connect(functools.partial(self.cancel, + remove_data=False)) q.cancelled.connect(functools.partial(self.cancel, remove_data=False)) self.cancelled.connect(q.abort) self.error.connect(q.abort) diff --git a/tests/end2end/features/test_downloads_bdd.py b/tests/end2end/features/test_downloads_bdd.py index a267a005b..3ce6790bb 100644 --- a/tests/end2end/features/test_downloads_bdd.py +++ b/tests/end2end/features/test_downloads_bdd.py @@ -42,7 +42,7 @@ def temporary_download_dir(quteproc, tmpdir): quteproc.set_setting('storage', 'download-directory', str(tmpdir)) (tmpdir / 'subdir').ensure(dir=True) try: - os.mkfifo(str(tmpdir / 'fifo')) + os.mkfifo(str(tmpdir / 'fifo')) except AttributeError: pass unwritable = tmpdir / 'unwritable' @@ -108,13 +108,15 @@ def download_prompt(tmpdir, quteproc, path): @bdd.when("I open the download") def download_open(quteproc): - cmd = '{} -c "import sys; print(sys.argv[1])"'.format(shlex.quote(sys.executable)) + cmd = '{} -c "import sys; print(sys.argv[1])"'.format( + shlex.quote(sys.executable)) quteproc.send_cmd(':download-open {}'.format(cmd)) @bdd.when("I open the download with a placeholder") -def download_open(quteproc): - cmd = '{} -c "import sys; print(sys.argv[1])"'.format(shlex.quote(sys.executable)) +def download_open_placeholder(quteproc): + cmd = '{} -c "import sys; print(sys.argv[1])"'.format( + shlex.quote(sys.executable)) quteproc.send_cmd(':download-open {} {{}}'.format(cmd)) diff --git a/tests/end2end/fixtures/webserver_sub.py b/tests/end2end/fixtures/webserver_sub.py index bd5e92f85..791faf9c3 100644 --- a/tests/end2end/fixtures/webserver_sub.py +++ b/tests/end2end/fixtures/webserver_sub.py @@ -87,7 +87,6 @@ def redirect_later_continue(): @app.route('/custom/content-size') def content_size(): """Send two bytes of data without a content-size.""" - def generate_bytes(): yield b'*' time.sleep(0.2) @@ -103,7 +102,6 @@ def content_size(): @app.route('/custom/twenty-mb') def twenty_mb(): """Send 20MB of data.""" - def generate_bytes(): yield b'*' * 20 * 1024 * 1024 diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py index dae273c8d..eade0b911 100644 --- a/tests/end2end/test_invocations.py +++ b/tests/end2end/test_invocations.py @@ -119,7 +119,7 @@ def test_ascii_locale(request, httpbin, tmpdir, quteproc_new): @pytest.mark.linux def test_misconfigured_user_dirs(request, httpbin, temp_basedir_env, tmpdir, quteproc_new): - """Test downloads with a misconfigured XDG_DOWNLOAD_DIR + """Test downloads with a misconfigured XDG_DOWNLOAD_DIR. https://github.com/The-Compiler/qutebrowser/issues/866 https://github.com/The-Compiler/qutebrowser/issues/1269 diff --git a/tests/unit/browser/webkit/test_downloads.py b/tests/unit/browser/webkit/test_downloads.py index 90871b9a0..c22e6fcf1 100644 --- a/tests/unit/browser/webkit/test_downloads.py +++ b/tests/unit/browser/webkit/test_downloads.py @@ -18,8 +18,6 @@ # along with qutebrowser. If not, see . -from PyQt5.QtCore import QUrl - from qutebrowser.browser.webkit import downloads