From a651f8b5506e1494642579a0fe8fbc37489dd84d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 26 Nov 2018 19:10:14 +0100 Subject: [PATCH 01/15] Update setuptools from 40.5.0 to 40.6.2 --- misc/requirements/requirements-pip.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pip.txt b/misc/requirements/requirements-pip.txt index a3068c5f9..04b033939 100644 --- a/misc/requirements/requirements-pip.txt +++ b/misc/requirements/requirements-pip.txt @@ -3,6 +3,6 @@ appdirs==1.4.3 packaging==18.0 pyparsing==2.3.0 -setuptools==40.5.0 +setuptools==40.6.2 six==1.11.0 wheel==0.32.2 From 343f3025fcf2ac2d11a296136ed6210b00550a3d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 26 Nov 2018 19:10:16 +0100 Subject: [PATCH 02/15] Update wheel from 0.32.2 to 0.32.3 --- misc/requirements/requirements-pip.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pip.txt b/misc/requirements/requirements-pip.txt index 04b033939..43085ddd7 100644 --- a/misc/requirements/requirements-pip.txt +++ b/misc/requirements/requirements-pip.txt @@ -5,4 +5,4 @@ packaging==18.0 pyparsing==2.3.0 setuptools==40.6.2 six==1.11.0 -wheel==0.32.2 +wheel==0.32.3 From 4791d581f8c101f2d9f26eb0d4cd07ea18ecdb5e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 26 Nov 2018 19:10:17 +0100 Subject: [PATCH 03/15] Update astroid from 2.0.4 to 2.1.0 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 30b038ef8..2cf83abba 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py asn1crypto==0.24.0 -astroid==2.0.4 +astroid==2.1.0 certifi==2018.10.15 cffi==1.11.5 chardet==3.0.4 From 6131cf538f063c795fe335b2654712d70fb512d4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 26 Nov 2018 19:10:19 +0100 Subject: [PATCH 04/15] Update cryptography from 2.4.1 to 2.4.2 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 2cf83abba..d8d090ac9 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -5,7 +5,7 @@ astroid==2.1.0 certifi==2018.10.15 cffi==1.11.5 chardet==3.0.4 -cryptography==2.4.1 +cryptography==2.4.2 github3.py==1.2.0 idna==2.7 isort==4.3.4 From 4318dd500ab07981579049570471e9cd73390e78 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 26 Nov 2018 19:10:21 +0100 Subject: [PATCH 05/15] Update pylint from 2.1.1 to 2.2.0 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index d8d090ac9..44c2b19e8 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -13,7 +13,7 @@ jwcrypto==0.6.0 lazy-object-proxy==1.3.1 mccabe==0.6.1 pycparser==2.19 -pylint==2.1.1 +pylint==2.2.0 python-dateutil==2.7.5 ./scripts/dev/pylint_checkers requests==2.20.1 From fe4baa8ceab885fac174254d3b3f175dfaa442a4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 26 Nov 2018 19:10:22 +0100 Subject: [PATCH 06/15] Update hunter from 2.0.2 to 2.1.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 27390c85a..d6bc1820e 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -12,7 +12,7 @@ EasyProcess==0.2.3 fields==5.0.0 Flask==1.0.2 glob2==0.6 -hunter==2.0.2 +hunter==2.1.0 hypothesis==3.82.1 itsdangerous==1.1.0 # Jinja2==2.10 From 866c009677b53bf6b1ec5786d89f05ab52969642 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 26 Nov 2018 19:10:24 +0100 Subject: [PATCH 07/15] Update pytest from 4.0.0 to 4.0.1 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index d6bc1820e..6ea860f19 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -24,7 +24,7 @@ parse-type==0.4.2 pluggy==0.8.0 py==1.7.0 py-cpuinfo==4.0.0 -pytest==4.0.0 +pytest==4.0.1 pytest-bdd==3.0.0 pytest-benchmark==3.1.1 pytest-cov==2.6.0 From 2cd67260fc99518315edf1bb380dafb8678a1ba5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 26 Nov 2018 19:10:26 +0100 Subject: [PATCH 08/15] Update colorama from 0.4.0 to 0.4.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 022a6214f..53da22d02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py attrs==18.2.0 -colorama==0.4.0 +colorama==0.4.1 cssutils==1.0.2 Jinja2==2.10 MarkupSafe==1.1.0 From 9a3e0a34e7a83d7190fa43bebd49df875b323dbc Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 26 Nov 2018 19:10:27 +0100 Subject: [PATCH 09/15] Update pygments from 2.2.0 to 2.3.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 53da22d02..66dcf23ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,6 @@ colorama==0.4.1 cssutils==1.0.2 Jinja2==2.10 MarkupSafe==1.1.0 -Pygments==2.2.0 +Pygments==2.3.0 pyPEG2==2.15.2 PyYAML==3.13 From 52c703a5ff45f4851c8fb13569a86151d7895bcf Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 28 Nov 2018 11:48:46 +0100 Subject: [PATCH 10/15] Update pylint to 2.2.2 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 44c2b19e8..8329ae0dd 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -13,7 +13,7 @@ jwcrypto==0.6.0 lazy-object-proxy==1.3.1 mccabe==0.6.1 pycparser==2.19 -pylint==2.2.0 +pylint==2.2.2 python-dateutil==2.7.5 ./scripts/dev/pylint_checkers requests==2.20.1 From 5ed3fb723d52092a1609c097c8a16e709a95911f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 28 Nov 2018 11:49:10 +0100 Subject: [PATCH 11/15] Regenerate requirements-tests --- misc/requirements/requirements-tests.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 6ea860f19..7d8a4f33e 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -6,10 +6,9 @@ backports.functools-lru-cache==1.5 beautifulsoup4==4.6.3 cheroot==6.5.2 Click==7.0 -# colorama==0.4.0 +# colorama==0.4.1 coverage==4.5.2 EasyProcess==0.2.3 -fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.1.0 From 2453134011a8a7fc3e813d55e578b72ea07a5a42 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 28 Nov 2018 11:26:40 +0100 Subject: [PATCH 12/15] Remove unnecessary pass statements --- qutebrowser/browser/downloads.py | 2 -- qutebrowser/browser/inspector.py | 2 -- qutebrowser/browser/network/pac.py | 4 --- qutebrowser/browser/qutescheme.py | 10 ------- qutebrowser/browser/urlmarks.py | 8 ------ qutebrowser/browser/webelem.py | 4 --- qutebrowser/browser/webkit/mhtml.py | 1 - .../browser/webkit/network/networkreply.py | 3 --- qutebrowser/browser/webkit/webkitelem.py | 2 -- qutebrowser/browser/webkit/webkithistory.py | 1 - qutebrowser/commands/cmdexc.py | 8 ------ qutebrowser/config/configexc.py | 2 -- qutebrowser/mainwindow/statusbar/keystring.py | 2 -- qutebrowser/misc/cmdhistory.py | 4 --- qutebrowser/misc/crashdialog.py | 2 -- qutebrowser/misc/sql.py | 4 --- qutebrowser/misc/utilcmds.py | 1 - qutebrowser/utils/objreg.py | 2 -- qutebrowser/utils/utils.py | 1 - scripts/hist_importer.py | 2 -- scripts/link_pyqt.py | 2 -- tests/end2end/fixtures/quteprocess.py | 2 -- tests/end2end/fixtures/testprocess.py | 6 ----- tests/helpers/stubs.py | 5 ---- tests/unit/commands/test_cmdutils.py | 26 +------------------ tests/unit/completion/test_completer.py | 6 ----- tests/unit/utils/test_qtutils.py | 5 ---- tests/unit/utils/test_utils.py | 9 ------- tests/unit/utils/usertypes/test_timer.py | 2 -- 29 files changed, 1 insertion(+), 127 deletions(-) diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index 92d846bd8..6d9e4b388 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -60,8 +60,6 @@ class UnsupportedAttribute: supported with QtWebengine. """ - pass - class UnsupportedOperationError(Exception): diff --git a/qutebrowser/browser/inspector.py b/qutebrowser/browser/inspector.py index 9b3fced2b..3334cea4e 100644 --- a/qutebrowser/browser/inspector.py +++ b/qutebrowser/browser/inspector.py @@ -49,8 +49,6 @@ class WebInspectorError(Exception): """Raised when the inspector could not be initialized.""" - pass - class AbstractWebInspector(QWidget): diff --git a/qutebrowser/browser/network/pac.py b/qutebrowser/browser/network/pac.py index 95ff99390..1c6075945 100644 --- a/qutebrowser/browser/network/pac.py +++ b/qutebrowser/browser/network/pac.py @@ -35,15 +35,11 @@ class ParseProxyError(Exception): """Error while parsing PAC result string.""" - pass - class EvalProxyError(Exception): """Error while evaluating PAC script.""" - pass - def _js_slot(*args): """Wrap a methods as a JavaScript function. diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index 0fa9366a6..769247e88 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -61,36 +61,26 @@ class Error(Exception): """Exception for generic errors on a qute:// page.""" - pass - class NotFoundError(Error): """Raised when the given URL was not found.""" - pass - class SchemeOSError(Error): """Raised when there was an OSError inside a handler.""" - pass - class UrlInvalidError(Error): """Raised when an invalid URL was opened.""" - pass - class RequestDeniedError(Error): """Raised when the request is forbidden.""" - pass - class Redirect(Exception): diff --git a/qutebrowser/browser/urlmarks.py b/qutebrowser/browser/urlmarks.py index bb20e2166..e32dbcc46 100644 --- a/qutebrowser/browser/urlmarks.py +++ b/qutebrowser/browser/urlmarks.py @@ -43,29 +43,21 @@ class Error(Exception): """Base class for all errors in this module.""" - pass - class InvalidUrlError(Error): """Exception emitted when a URL is invalid.""" - pass - class DoesNotExistError(Error): """Exception emitted when a given URL does not exist.""" - pass - class AlreadyExistsError(Error): """Exception emitted when a given URL does already exist.""" - pass - class UrlMarkManager(QObject): diff --git a/qutebrowser/browser/webelem.py b/qutebrowser/browser/webelem.py index e39eb5850..520b7d12b 100644 --- a/qutebrowser/browser/webelem.py +++ b/qutebrowser/browser/webelem.py @@ -34,15 +34,11 @@ class Error(Exception): """Base class for WebElement errors.""" - pass - class OrphanedError(Error): """Raised when a webelement's parent has vanished.""" - pass - def css_selector(group, url): """Get a CSS selector for the given group/URL.""" diff --git a/qutebrowser/browser/webkit/mhtml.py b/qutebrowser/browser/webkit/mhtml.py index 9339df9ce..1ecebed2d 100644 --- a/qutebrowser/browser/webkit/mhtml.py +++ b/qutebrowser/browser/webkit/mhtml.py @@ -516,7 +516,6 @@ class _NoCloseBytesIO(io.BytesIO): def close(self): """Do nothing.""" - pass def actual_close(self): """Close the stream.""" diff --git a/qutebrowser/browser/webkit/network/networkreply.py b/qutebrowser/browser/webkit/network/networkreply.py index dc6bed5ed..c56fe2a9b 100644 --- a/qutebrowser/browser/webkit/network/networkreply.py +++ b/qutebrowser/browser/webkit/network/networkreply.py @@ -67,7 +67,6 @@ class FixedDataNetworkReply(QNetworkReply): @pyqtSlot() def abort(self): """Abort the operation.""" - pass def bytesAvailable(self): """Determine the bytes available for being read. @@ -123,7 +122,6 @@ class ErrorNetworkReply(QNetworkReply): def abort(self): """Do nothing since it's a fake reply.""" - pass def bytesAvailable(self): """We always have 0 bytes available.""" @@ -151,7 +149,6 @@ class RedirectNetworkReply(QNetworkReply): def abort(self): """Called when there's e.g. a redirection limit.""" - pass def readData(self, _maxlen): return bytes() diff --git a/qutebrowser/browser/webkit/webkitelem.py b/qutebrowser/browser/webkit/webkitelem.py index 01a2736dc..66d5e59b8 100644 --- a/qutebrowser/browser/webkit/webkitelem.py +++ b/qutebrowser/browser/webkit/webkitelem.py @@ -31,8 +31,6 @@ class IsNullError(webelem.Error): """Gets raised by WebKitElement if an element is null.""" - pass - class WebKitElement(webelem.AbstractWebElement): diff --git a/qutebrowser/browser/webkit/webkithistory.py b/qutebrowser/browser/webkit/webkithistory.py index 2c719acd6..65d9bbb01 100644 --- a/qutebrowser/browser/webkit/webkithistory.py +++ b/qutebrowser/browser/webkit/webkithistory.py @@ -41,7 +41,6 @@ class WebHistoryInterface(QWebHistoryInterface): def addHistoryEntry(self, url_string): """Required for a QWebHistoryInterface impl, obsoleted by add_url.""" - pass @functools.lru_cache(maxsize=32768) def historyContains(self, url_string): diff --git a/qutebrowser/commands/cmdexc.py b/qutebrowser/commands/cmdexc.py index 5d3ac2a89..dbc5da581 100644 --- a/qutebrowser/commands/cmdexc.py +++ b/qutebrowser/commands/cmdexc.py @@ -32,22 +32,16 @@ class CommandError(Error): """Raised when a command encounters an error while running.""" - pass - class NoSuchCommandError(Error): """Raised when a command wasn't found.""" - pass - class ArgumentTypeError(Error): """Raised when an argument had an invalid type.""" - pass - class PrerequisitesError(Error): @@ -56,5 +50,3 @@ class PrerequisitesError(Error): This is raised for example when we're in the wrong mode while executing the command, or we need javascript enabled but don't have done so. """ - - pass diff --git a/qutebrowser/config/configexc.py b/qutebrowser/config/configexc.py index 2a99dfa5c..051ed971a 100644 --- a/qutebrowser/config/configexc.py +++ b/qutebrowser/config/configexc.py @@ -28,8 +28,6 @@ class Error(Exception): """Base exception for config-related errors.""" - pass - class NoAutoconfigError(Error): diff --git a/qutebrowser/mainwindow/statusbar/keystring.py b/qutebrowser/mainwindow/statusbar/keystring.py index 29dd3b790..73b23a65d 100644 --- a/qutebrowser/mainwindow/statusbar/keystring.py +++ b/qutebrowser/mainwindow/statusbar/keystring.py @@ -25,5 +25,3 @@ from qutebrowser.mainwindow.statusbar import textbase class KeyString(textbase.TextBase): """Keychain string displayed in the statusbar.""" - - pass diff --git a/qutebrowser/misc/cmdhistory.py b/qutebrowser/misc/cmdhistory.py index 9fa273c1c..0a3ac9fa9 100644 --- a/qutebrowser/misc/cmdhistory.py +++ b/qutebrowser/misc/cmdhistory.py @@ -29,15 +29,11 @@ class HistoryEmptyError(Exception): """Raised when the history is empty.""" - pass - class HistoryEndReachedError(Exception): """Raised when the end of the history is reached.""" - pass - class History(QObject): diff --git a/qutebrowser/misc/crashdialog.py b/qutebrowser/misc/crashdialog.py index 27dec3345..e2b9bd05f 100644 --- a/qutebrowser/misc/crashdialog.py +++ b/qutebrowser/misc/crashdialog.py @@ -197,7 +197,6 @@ class _CrashDialog(QDialog): def _init_checkboxes(self): """Initialize the checkboxes.""" - pass def _init_buttons(self): """Initialize the buttons.""" @@ -569,7 +568,6 @@ class ReportDialog(_CrashDialog): def _init_info_text(self): """We don't want an info text as the user wanted to report.""" - pass def _get_error_type(self): return 'report' diff --git a/qutebrowser/misc/sql.py b/qutebrowser/misc/sql.py index 4c300a3da..eda778194 100644 --- a/qutebrowser/misc/sql.py +++ b/qutebrowser/misc/sql.py @@ -72,8 +72,6 @@ class SqlEnvironmentError(SqlError): disk or I/O errors), where qutebrowser isn't to blame. """ - pass - class SqlBugError(SqlError): @@ -82,8 +80,6 @@ class SqlBugError(SqlError): This is raised for errors resulting from a qutebrowser bug. """ - pass - def raise_sqlite_error(msg, error): """Raise either a SqlBugError or SqlEnvironmentError.""" diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index d108a56ac..1245d06ba 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -370,7 +370,6 @@ def window_only(current_win_id): @cmdutils.register() def nop(): """Do nothing.""" - pass @cmdutils.register() diff --git a/qutebrowser/utils/objreg.py b/qutebrowser/utils/objreg.py index 17fc34b92..b68ca133c 100644 --- a/qutebrowser/utils/objreg.py +++ b/qutebrowser/utils/objreg.py @@ -42,8 +42,6 @@ class RegistryUnavailableError(Exception): """Exception raised when a certain registry does not exist yet.""" - pass - class NoWindow(Exception): diff --git a/qutebrowser/utils/utils.py b/qutebrowser/utils/utils.py index 6119675ba..1ac7a1a8c 100644 --- a/qutebrowser/utils/utils.py +++ b/qutebrowser/utils/utils.py @@ -630,7 +630,6 @@ def open_file(filename, cmdline=None): def unused(_arg): """Function which does nothing to avoid pylint complaining.""" - pass def expand_windows_drive(path): diff --git a/scripts/hist_importer.py b/scripts/hist_importer.py index 914701a19..31936b4c1 100755 --- a/scripts/hist_importer.py +++ b/scripts/hist_importer.py @@ -33,8 +33,6 @@ class Error(Exception): """Exception for errors in this module.""" - pass - def parse(): """Parse command line arguments.""" diff --git a/scripts/link_pyqt.py b/scripts/link_pyqt.py index ae7eaa622..e16056fa8 100644 --- a/scripts/link_pyqt.py +++ b/scripts/link_pyqt.py @@ -34,8 +34,6 @@ class Error(Exception): """Exception raised when linking fails.""" - pass - def run_py(executable, *code): """Run the given python code with the given executable.""" diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index f4e5d1486..561d92a80 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -842,8 +842,6 @@ class YamlLoader(yaml.SafeLoader): """Custom YAML loader used in compare_session.""" - pass - # Translate ... to ellipsis in YAML. YamlLoader.add_constructor('!ellipsis', lambda loader, node: ...) diff --git a/tests/end2end/fixtures/testprocess.py b/tests/end2end/fixtures/testprocess.py index d0af5bebc..eab914a1a 100644 --- a/tests/end2end/fixtures/testprocess.py +++ b/tests/end2end/fixtures/testprocess.py @@ -39,15 +39,11 @@ class InvalidLine(Exception): """Raised when the process prints a line which is not parsable.""" - pass - class ProcessExited(Exception): """Raised when the child process did exit.""" - pass - class WaitForTimeout(Exception): @@ -271,7 +267,6 @@ class Process(QObject): def _after_start(self): """Do things which should be done immediately after starting.""" - pass def before_test(self): """Restart process before a test if it exited before.""" @@ -443,7 +438,6 @@ class Process(QObject): QuteProc._maybe_skip, and call _maybe_skip after every parsed message in wait_for (where it's most likely that new messages arrive). """ - pass def wait_for(self, timeout=None, *, override_waited_for=False, do_skip=False, divisor=1, after=None, **kwargs): diff --git a/tests/helpers/stubs.py b/tests/helpers/stubs.py index 9bf5b837d..e050e1fb5 100644 --- a/tests/helpers/stubs.py +++ b/tests/helpers/stubs.py @@ -306,7 +306,6 @@ class FakeSignal: Currently does nothing, but could be improved to do some sanity checking on the slot. """ - pass def disconnect(self, slot=None): """Disconnect the signal from a slot. @@ -314,7 +313,6 @@ class FakeSignal: Currently does nothing, but could be improved to do some sanity checking on the slot and see if it actually got connected. """ - pass def emit(self, *args): """Emit the signal. @@ -322,7 +320,6 @@ class FakeSignal: Currently does nothing, but could be improved to do type checking based on a signature given to __init__. """ - pass @attr.s @@ -457,8 +454,6 @@ class BookmarkManagerStub(UrlMarkManagerStub): """Stub for the bookmark-manager object.""" - pass - class QuickmarkManagerStub(UrlMarkManagerStub): diff --git a/tests/unit/commands/test_cmdutils.py b/tests/unit/commands/test_cmdutils.py index fc68fa920..ef7c97164 100644 --- a/tests/unit/commands/test_cmdutils.py +++ b/tests/unit/commands/test_cmdutils.py @@ -48,7 +48,6 @@ def _get_cmd(*args, **kwargs): @cmdutils.register(*args, **kwargs) def fun(): """Blah.""" - pass return cmdutils.cmd_dict['fun'] @@ -83,7 +82,6 @@ class TestRegister: @cmdutils.register() def fun(): """Blah.""" - pass cmd = cmdutils.cmd_dict['fun'] assert cmd.handler is fun @@ -95,7 +93,6 @@ class TestRegister: @cmdutils.register() def eggs_bacon(): """Blah.""" - pass assert cmdutils.cmd_dict['eggs-bacon'].name == 'eggs-bacon' assert 'eggs_bacon' not in cmdutils.cmd_dict @@ -105,7 +102,6 @@ class TestRegister: @cmdutils.register() def Test(): # noqa: N801,N806 pylint: disable=invalid-name """Blah.""" - pass assert cmdutils.cmd_dict['test'].name == 'test' assert 'Test' not in cmdutils.cmd_dict @@ -115,7 +111,6 @@ class TestRegister: @cmdutils.register(name='foobar') def fun(): """Blah.""" - pass assert cmdutils.cmd_dict['foobar'].name == 'foobar' assert 'fun' not in cmdutils.cmd_dict @@ -126,20 +121,17 @@ class TestRegister: @cmdutils.register(name='foobar') def fun(): """Blah.""" - pass with pytest.raises(ValueError): @cmdutils.register(name='foobar') def fun2(): """Blah.""" - pass def test_instance(self): """Make sure the instance gets passed to Command.""" @cmdutils.register(instance='foobar') def fun(self): """Blah.""" - pass assert cmdutils.cmd_dict['fun']._instance == 'foobar' def test_star_args(self): @@ -147,7 +139,6 @@ class TestRegister: @cmdutils.register() def fun(*args): """Blah.""" - pass with pytest.raises(argparser.ArgumentParserError): cmdutils.cmd_dict['fun'].parser.parse_args([]) @@ -195,14 +186,12 @@ class TestRegister: @cmdutils.argument('arg1', flag='b') def fun(arg1=False, arg2=False): """Blah.""" - pass def test_win_id(self): @cmdutils.register() @cmdutils.argument('win_id', win_id=True) def fun(win_id): """Blah.""" - pass assert cmdutils.cmd_dict['fun']._get_call_args(42) == ([42], {}) def test_count(self): @@ -210,7 +199,6 @@ class TestRegister: @cmdutils.argument('count', count=True) def fun(count=0): """Blah.""" - pass assert cmdutils.cmd_dict['fun']._get_call_args(42) == ([0], {}) def test_count_without_default(self): @@ -220,7 +208,6 @@ class TestRegister: @cmdutils.argument('count', count=True) def fun(count): """Blah.""" - pass @pytest.mark.parametrize('hide', [True, False]) def test_pos_args(self, hide): @@ -228,7 +215,6 @@ class TestRegister: @cmdutils.argument('arg', hide=hide) def fun(arg): """Blah.""" - pass pos_args = cmdutils.cmd_dict['fun'].pos_args if hide: @@ -283,7 +269,6 @@ class TestRegister: @cmdutils.argument('arg', choices=['foo', 'bar']) def fun(arg): """Blah.""" - pass cmd = cmdutils.cmd_dict['fun'] cmd.namespace = cmd.parser.parse_args(['fish']) @@ -297,7 +282,6 @@ class TestRegister: @cmdutils.argument('arg', choices=['foo', 'bar']) def fun(*, arg='foo'): """Blah.""" - pass cmd = cmdutils.cmd_dict['fun'] cmd.namespace = cmd.parser.parse_args(['--arg=fish']) @@ -312,7 +296,6 @@ class TestRegister: @cmdutils.argument('opt') def fun(foo, bar, opt=False): """Blah.""" - pass cmd = cmdutils.cmd_dict['fun'] assert cmd.get_pos_arg_info(0) == command.ArgInfo(choices=('a', 'b')) @@ -324,7 +307,6 @@ class TestRegister: # https://github.com/qutebrowser/qutebrowser/issues/1872 def fun(*, target): """Blah.""" - pass with pytest.raises(TypeError, match="fun: handler has keyword only " "argument 'target' without default!"): @@ -334,7 +316,6 @@ class TestRegister: # https://github.com/qutebrowser/qutebrowser/issues/1872 def fun(*, target: int): """Blah.""" - pass with pytest.raises(TypeError, match="fun: handler has keyword only " "argument 'target' without default!"): @@ -350,14 +331,12 @@ class TestArgument: @cmdutils.argument('foo') def fun(bar): """Blah.""" - pass def test_storage(self): @cmdutils.argument('foo', flag='x') @cmdutils.argument('bar', flag='y') def fun(foo, bar): """Blah.""" - pass expected = { 'foo': command.ArgInfo(flag='x'), 'bar': command.ArgInfo(flag='y') @@ -372,7 +351,6 @@ class TestArgument: @cmdutils.register() def fun(bar): """Blah.""" - pass def test_count_and_win_id_same_arg(self): with pytest.raises(TypeError, @@ -380,7 +358,6 @@ class TestArgument: @cmdutils.argument('arg', count=True, win_id=True) def fun(arg=0): """Blah.""" - pass def test_no_docstring(self, caplog): with caplog.at_level(logging.WARNING): @@ -388,6 +365,7 @@ class TestArgument: def fun(): # no docstring pass + assert len(caplog.records) == 1 assert caplog.messages[0].endswith('test_cmdutils.py has no docstring') @@ -398,7 +376,6 @@ class TestArgument: @cmdutils.register() def fun(): # no docstring - pass class TestRun: @@ -441,7 +418,6 @@ class TestRun: backend=usertypes.Backend.QtWebEngine) def fun(self): """Blah.""" - pass monkeypatch.setattr(command.objects, 'backend', usertypes.Backend.QtWebKit) diff --git a/tests/unit/completion/test_completer.py b/tests/unit/completion/test_completer.py index dc98f0efb..8620241e4 100644 --- a/tests/unit/completion/test_completer.py +++ b/tests/unit/completion/test_completer.py @@ -105,35 +105,29 @@ def cmdutils_patch(monkeypatch, stubs, miscmodels_patch): @cmdutils.argument('value', completion=miscmodels_patch.value) def set_command(section_=None, option=None, value=None): """docstring.""" - pass @cmdutils.argument('topic', completion=miscmodels_patch.helptopic) def show_help(tab=False, bg=False, window=False, topic=None): """docstring.""" - pass @cmdutils.argument('url', completion=miscmodels_patch.url) @cmdutils.argument('count', count=True) def openurl(url=None, related=False, bg=False, tab=False, window=False, count=None): """docstring.""" - pass @cmdutils.argument('win_id', win_id=True) @cmdutils.argument('command', completion=miscmodels_patch.command) def bind(key, win_id, command=None, *, mode='normal'): """docstring.""" - pass def tab_give(): """docstring.""" - pass @cmdutils.argument('option', completion=miscmodels_patch.option) @cmdutils.argument('values', completion=miscmodels_patch.value) def config_cycle(option, *values): """For testing varargs.""" - pass cmd_utils = stubs.FakeCmdUtils({ 'set': command.Command(name='set', handler=set_command), diff --git a/tests/unit/utils/test_qtutils.py b/tests/unit/utils/test_qtutils.py index 0825d1fb3..3b625b3a5 100644 --- a/tests/unit/utils/test_qtutils.py +++ b/tests/unit/utils/test_qtutils.py @@ -336,8 +336,6 @@ class SavefileTestException(Exception): """Exception raised in TestSavefileOpen for testing.""" - pass - @pytest.mark.usefixtures('qapp') class TestSavefileOpen: @@ -541,7 +539,6 @@ if test_file is not None: def testReadinto_text(self): """Skip this test as BufferedIOBase seems to fail it.""" - pass class PyOtherFileTests(PyIODeviceTestMixin, test_file.OtherFileTests, unittest.TestCase): @@ -550,11 +547,9 @@ if test_file is not None: def testSetBufferSize(self): """Skip this test as setting buffer size is unsupported.""" - pass def testTruncateOnWindows(self): """Skip this test truncating is unsupported.""" - pass class FailingQIODevice(QIODevice): diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py index e25ecfe4a..ccabfa050 100644 --- a/tests/unit/utils/test_utils.py +++ b/tests/unit/utils/test_utils.py @@ -409,8 +409,6 @@ class GotException(Exception): """Exception used for TestDisabledExcepthook.""" - pass - def excepthook(_exc, _val, _tb): pass @@ -512,8 +510,6 @@ class Obj: """Test object for test_get_repr().""" - pass - @pytest.mark.parametrize('constructor, attrs, expected', [ (False, {}, ''), @@ -534,12 +530,10 @@ class QualnameObj(): def func(self): """Test method for test_qualname.""" - pass def qualname_func(_blah): """Test function for test_qualname.""" - pass QUALNAME_OBJ = QualnameObj() @@ -578,8 +572,6 @@ class TestIsEnum: """Test class for is_enum.""" - pass - assert not utils.is_enum(Test) def test_object(self): @@ -597,7 +589,6 @@ class TestRaises: def do_nothing(self): """Helper function which does nothing.""" - pass @pytest.mark.parametrize('exception, value, expected', [ (ValueError, 'a', True), diff --git a/tests/unit/utils/usertypes/test_timer.py b/tests/unit/utils/usertypes/test_timer.py index 2ead0dc60..928e9d6a8 100644 --- a/tests/unit/utils/usertypes/test_timer.py +++ b/tests/unit/utils/usertypes/test_timer.py @@ -29,8 +29,6 @@ class Parent(QObject): """Class for test_parent().""" - pass - def test_parent(): """Make sure the parent is set correctly.""" From 2237ca2bcfa94d5521d735c66c3c4b83759ed763 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 28 Nov 2018 12:54:19 +0100 Subject: [PATCH 13/15] Remove now unneeded pylint suppressions --- qutebrowser/browser/webengine/webenginedownloads.py | 3 +-- qutebrowser/misc/backendproblem.py | 1 - qutebrowser/misc/earlyinit.py | 3 +-- qutebrowser/utils/qtutils.py | 2 +- scripts/dev/build_release.py | 2 +- tests/conftest.py | 3 +-- tests/unit/misc/test_checkpyver.py | 2 +- tests/unit/utils/test_utils.py | 4 ---- 8 files changed, 6 insertions(+), 14 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginedownloads.py b/qutebrowser/browser/webengine/webenginedownloads.py index 94caa887e..6dde42070 100644 --- a/qutebrowser/browser/webengine/webenginedownloads.py +++ b/qutebrowser/browser/webengine/webenginedownloads.py @@ -117,8 +117,7 @@ class DownloadItem(downloads.AbstractDownloadItem): def _get_open_filename(self): return self._filename - def _set_fileobj(self, fileobj, *, - autoclose=True): # pylint: disable=unused-argument + def _set_fileobj(self, fileobj, *, autoclose=True): raise downloads.UnsupportedOperationError def _set_tempfile(self, fileobj): diff --git a/qutebrowser/misc/backendproblem.py b/qutebrowser/misc/backendproblem.py index d5f7c9680..53094a257 100644 --- a/qutebrowser/misc/backendproblem.py +++ b/qutebrowser/misc/backendproblem.py @@ -280,7 +280,6 @@ class BackendImports: def _try_import_backends(): """Check whether backends can be imported and return BackendImports.""" - # pylint: disable=unused-variable results = BackendImports() try: diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index b29e1508f..5e650510c 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -133,7 +133,7 @@ def init_faulthandler(fileobj=sys.__stderr__): def check_pyqt_core(): """Check if PyQt core is installed.""" try: - import PyQt5.QtCore # pylint: disable=unused-variable + import PyQt5.QtCore except ImportError as e: text = _missing_str('PyQt5') text = text.replace('', '') @@ -187,7 +187,6 @@ def check_qt_version(): def check_ssl_support(): """Check if SSL support is available.""" - # pylint: disable=unused-variable try: from PyQt5.QtNetwork import QSslSocket except ImportError: diff --git a/qutebrowser/utils/qtutils.py b/qutebrowser/utils/qtutils.py index c634eb95f..6905c2fbc 100644 --- a/qutebrowser/utils/qtutils.py +++ b/qutebrowser/utils/qtutils.py @@ -285,7 +285,7 @@ class PyQIODevice(io.BufferedIOBase): if not ok: raise QtOSError(self.dev, msg="seek failed!") - def truncate(self, size=None): # pylint: disable=unused-argument + def truncate(self, size=None): raise io.UnsupportedOperation @property diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index e3f039336..6749be676 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -370,7 +370,7 @@ def main(): if args.upload is not None: # Fail early when trying to upload without github3 installed # or without API token - import github3 # pylint: disable=unused-variable + import github3 read_github_token() if args.no_asciidoc: diff --git a/tests/conftest.py b/tests/conftest.py index f53a70054..d06dfcfa6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -206,7 +206,6 @@ def pytest_configure(config): webengine_env = os.environ.get('QUTE_BDD_WEBENGINE', '') config.webengine = bool(webengine_arg or webengine_env) # Fail early if QtWebEngine is not available - # pylint: disable=unused-variable if config.webengine: import PyQt5.QtWebEngineWidgets @@ -283,7 +282,7 @@ def apply_fake_os(monkeypatch, request): def check_yaml_c_exts(): """Make sure PyYAML C extensions are available on Travis.""" if 'TRAVIS' in os.environ: - from yaml import CLoader # pylint: disable=unused-variable + from yaml import CLoader @pytest.hookimpl(tryfirst=True, hookwrapper=True) diff --git a/tests/unit/misc/test_checkpyver.py b/tests/unit/misc/test_checkpyver.py index 17e910a5f..15fc31d18 100644 --- a/tests/unit/misc/test_checkpyver.py +++ b/tests/unit/misc/test_checkpyver.py @@ -73,7 +73,7 @@ def test_patched_errwindow(capfd, mocker, monkeypatch): monkeypatch.setattr(checkpyver.sys, 'exit', lambda status: None) try: - import tkinter # pylint: disable=unused-variable + import tkinter except ImportError: tk_mock = mocker.patch('qutebrowser.misc.checkpyver.Tk', spec=['withdraw'], new_callable=mocker.Mock) diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py index ccabfa050..37bd9faaa 100644 --- a/tests/unit/utils/test_utils.py +++ b/tests/unit/utils/test_utils.py @@ -463,9 +463,7 @@ class TestPreventExceptions: def test_raising(self, caplog): """Test with a raising function.""" with caplog.at_level(logging.ERROR, 'misc'): - # pylint: disable=assignment-from-no-return ret = self.func_raising() - # pylint: enable=assignment-from-no-return assert ret == 42 expected = 'Error in test_utils.TestPreventExceptions.func_raising' assert caplog.messages == [expected] @@ -488,9 +486,7 @@ class TestPreventExceptions: def test_predicate_true(self, caplog): """Test with a True predicate.""" with caplog.at_level(logging.ERROR, 'misc'): - # pylint: disable=assignment-from-no-return ret = self.func_predicate_true() - # enable: disable=assignment-from-no-return assert ret == 42 assert len(caplog.records) == 1 From 14fe7f9b0b7683b5024366e73d388900cfbcbb05 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 28 Nov 2018 12:58:48 +0100 Subject: [PATCH 14/15] pass fixup --- tests/unit/commands/test_cmdutils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/commands/test_cmdutils.py b/tests/unit/commands/test_cmdutils.py index ef7c97164..718695874 100644 --- a/tests/unit/commands/test_cmdutils.py +++ b/tests/unit/commands/test_cmdutils.py @@ -376,6 +376,7 @@ class TestArgument: @cmdutils.register() def fun(): # no docstring + pass class TestRun: From b5253ec47381ef5c86e964375d4b26e0ffd46729 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 28 Nov 2018 13:01:43 +0100 Subject: [PATCH 15/15] Fix lint --- qutebrowser/app.py | 2 +- qutebrowser/misc/backendproblem.py | 1 + qutebrowser/misc/earlyinit.py | 4 ++-- scripts/dev/build_release.py | 2 +- scripts/dev/src2asciidoc.py | 2 +- tests/end2end/fixtures/webserver.py | 3 ++- tests/unit/browser/test_pdfjs.py | 4 ++-- tests/unit/browser/webkit/http/test_http_hypothesis.py | 2 +- tests/unit/misc/test_checkpyver.py | 2 +- 9 files changed, 12 insertions(+), 10 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 7d1b61131..161bc5297 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -193,7 +193,7 @@ def _init_icon(): icon = QIcon() fallback_icon = QIcon() for size in [16, 24, 32, 48, 64, 96, 128, 256, 512]: - filename = ':/icons/qutebrowser-{}x{}.png'.format(size, size) + filename = ':/icons/qutebrowser-{size}x{size}.png'.format(size=size) pixmap = QPixmap(filename) if pixmap.isNull(): log.init.warning("Failed to load {}".format(filename)) diff --git a/qutebrowser/misc/backendproblem.py b/qutebrowser/misc/backendproblem.py index 53094a257..2099afa88 100644 --- a/qutebrowser/misc/backendproblem.py +++ b/qutebrowser/misc/backendproblem.py @@ -280,6 +280,7 @@ class BackendImports: def _try_import_backends(): """Check whether backends can be imported and return BackendImports.""" + # pylint: disable=unused-import results = BackendImports() try: diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index 5e650510c..a7571fdaa 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -133,7 +133,7 @@ def init_faulthandler(fileobj=sys.__stderr__): def check_pyqt_core(): """Check if PyQt core is installed.""" try: - import PyQt5.QtCore + import PyQt5.QtCore # pylint: disable=unused-import except ImportError as e: text = _missing_str('PyQt5') text = text.replace('', '') @@ -188,7 +188,7 @@ def check_qt_version(): def check_ssl_support(): """Check if SSL support is available.""" try: - from PyQt5.QtNetwork import QSslSocket + from PyQt5.QtNetwork import QSslSocket # pylint: disable=unused-import except ImportError: _die("Fatal error: Your Qt is built without SSL support.") diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 6749be676..8591f1c31 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -370,7 +370,7 @@ def main(): if args.upload is not None: # Fail early when trying to upload without github3 installed # or without API token - import github3 + import github3 # pylint: disable=unused-import read_github_token() if args.no_asciidoc: diff --git a/scripts/dev/src2asciidoc.py b/scripts/dev/src2asciidoc.py index cc00c3757..8c6f2e44d 100755 --- a/scripts/dev/src2asciidoc.py +++ b/scripts/dev/src2asciidoc.py @@ -135,7 +135,7 @@ def _get_command_quickref(cmds): out.append('|Command|Description') for name, cmd in cmds: desc = inspect.getdoc(cmd.handler).splitlines()[0] - out.append('|<<{},{}>>|{}'.format(name, name, desc)) + out.append('|<<{name},{name}>>|{desc}'.format(name=name, desc=desc)) out.append('|==============') return '\n'.join(out) diff --git a/tests/end2end/fixtures/webserver.py b/tests/end2end/fixtures/webserver.py index 254b5ffaf..d1e45409e 100644 --- a/tests/end2end/fixtures/webserver.py +++ b/tests/end2end/fixtures/webserver.py @@ -82,7 +82,8 @@ class Request(testprocess.Line): for i in range(15): path_to_statuses['/redirect/{}'.format(i)] = [HTTPStatus.FOUND] for suffix in ['', '1', '2', '3', '4', '5', '6']: - key = '/basic-auth/user{}/password{}'.format(suffix, suffix) + key = ('/basic-auth/user{suffix}/password{suffix}' + .format(suffix=suffix)) path_to_statuses[key] = [HTTPStatus.UNAUTHORIZED, HTTPStatus.OK] default_statuses = [HTTPStatus.OK, HTTPStatus.NOT_MODIFIED] diff --git a/tests/unit/browser/test_pdfjs.py b/tests/unit/browser/test_pdfjs.py index 7fa1a8f6c..dcee2b82b 100644 --- a/tests/unit/browser/test_pdfjs.py +++ b/tests/unit/browser/test_pdfjs.py @@ -82,14 +82,14 @@ def test_generate_pdfjs_script_disable_object_url(monkeypatch, if qt == 'new': monkeypatch.setattr(pdfjs.qtutils, 'version_check', lambda version, exact=False, compiled=True: - False if version == '5.7.1' else True) + version != '5.7.1') elif qt == 'old': monkeypatch.setattr(pdfjs.qtutils, 'version_check', lambda version, exact=False, compiled=True: False) elif qt == '5.7': monkeypatch.setattr(pdfjs.qtutils, 'version_check', lambda version, exact=False, compiled=True: - True if version == '5.7.1' else False) + version == '5.7.1') else: raise utils.Unreachable diff --git a/tests/unit/browser/webkit/http/test_http_hypothesis.py b/tests/unit/browser/webkit/http/test_http_hypothesis.py index ec8ee4aff..5727bf1bc 100644 --- a/tests/unit/browser/webkit/http/test_http_hypothesis.py +++ b/tests/unit/browser/webkit/http/test_http_hypothesis.py @@ -31,7 +31,7 @@ from qutebrowser.browser.webkit import http, rfc6266 'attachment; filename="{}"', 'inline; {}', 'attachment; {}="foo"', - 'attachment; filename*=iso-8859-1''{}', + "attachment; filename*=iso-8859-1''{}", 'attachment; filename*={}', ]) @hypothesis.given(strategies.text(alphabet=[chr(x) for x in range(255)])) diff --git a/tests/unit/misc/test_checkpyver.py b/tests/unit/misc/test_checkpyver.py index 15fc31d18..a02e2f8e0 100644 --- a/tests/unit/misc/test_checkpyver.py +++ b/tests/unit/misc/test_checkpyver.py @@ -73,7 +73,7 @@ def test_patched_errwindow(capfd, mocker, monkeypatch): monkeypatch.setattr(checkpyver.sys, 'exit', lambda status: None) try: - import tkinter + import tkinter # pylint: disable=unused-import except ImportError: tk_mock = mocker.patch('qutebrowser.misc.checkpyver.Tk', spec=['withdraw'], new_callable=mocker.Mock)