Remove now unneeded pylint suppressions

This commit is contained in:
Florian Bruhin 2018-11-28 12:54:19 +01:00
parent 2453134011
commit 2237ca2bcf
8 changed files with 6 additions and 14 deletions

View File

@ -117,8 +117,7 @@ class DownloadItem(downloads.AbstractDownloadItem):
def _get_open_filename(self): def _get_open_filename(self):
return self._filename return self._filename
def _set_fileobj(self, fileobj, *, def _set_fileobj(self, fileobj, *, autoclose=True):
autoclose=True): # pylint: disable=unused-argument
raise downloads.UnsupportedOperationError raise downloads.UnsupportedOperationError
def _set_tempfile(self, fileobj): def _set_tempfile(self, fileobj):

View File

@ -280,7 +280,6 @@ class BackendImports:
def _try_import_backends(): def _try_import_backends():
"""Check whether backends can be imported and return BackendImports.""" """Check whether backends can be imported and return BackendImports."""
# pylint: disable=unused-variable
results = BackendImports() results = BackendImports()
try: try:

View File

@ -133,7 +133,7 @@ def init_faulthandler(fileobj=sys.__stderr__):
def check_pyqt_core(): def check_pyqt_core():
"""Check if PyQt core is installed.""" """Check if PyQt core is installed."""
try: try:
import PyQt5.QtCore # pylint: disable=unused-variable import PyQt5.QtCore
except ImportError as e: except ImportError as e:
text = _missing_str('PyQt5') text = _missing_str('PyQt5')
text = text.replace('<b>', '') text = text.replace('<b>', '')
@ -187,7 +187,6 @@ def check_qt_version():
def check_ssl_support(): def check_ssl_support():
"""Check if SSL support is available.""" """Check if SSL support is available."""
# pylint: disable=unused-variable
try: try:
from PyQt5.QtNetwork import QSslSocket from PyQt5.QtNetwork import QSslSocket
except ImportError: except ImportError:

View File

@ -285,7 +285,7 @@ class PyQIODevice(io.BufferedIOBase):
if not ok: if not ok:
raise QtOSError(self.dev, msg="seek failed!") raise QtOSError(self.dev, msg="seek failed!")
def truncate(self, size=None): # pylint: disable=unused-argument def truncate(self, size=None):
raise io.UnsupportedOperation raise io.UnsupportedOperation
@property @property

View File

@ -370,7 +370,7 @@ def main():
if args.upload is not None: if args.upload is not None:
# Fail early when trying to upload without github3 installed # Fail early when trying to upload without github3 installed
# or without API token # or without API token
import github3 # pylint: disable=unused-variable import github3
read_github_token() read_github_token()
if args.no_asciidoc: if args.no_asciidoc:

View File

@ -206,7 +206,6 @@ def pytest_configure(config):
webengine_env = os.environ.get('QUTE_BDD_WEBENGINE', '') webengine_env = os.environ.get('QUTE_BDD_WEBENGINE', '')
config.webengine = bool(webengine_arg or webengine_env) config.webengine = bool(webengine_arg or webengine_env)
# Fail early if QtWebEngine is not available # Fail early if QtWebEngine is not available
# pylint: disable=unused-variable
if config.webengine: if config.webengine:
import PyQt5.QtWebEngineWidgets import PyQt5.QtWebEngineWidgets
@ -283,7 +282,7 @@ def apply_fake_os(monkeypatch, request):
def check_yaml_c_exts(): def check_yaml_c_exts():
"""Make sure PyYAML C extensions are available on Travis.""" """Make sure PyYAML C extensions are available on Travis."""
if 'TRAVIS' in os.environ: if 'TRAVIS' in os.environ:
from yaml import CLoader # pylint: disable=unused-variable from yaml import CLoader
@pytest.hookimpl(tryfirst=True, hookwrapper=True) @pytest.hookimpl(tryfirst=True, hookwrapper=True)

View File

@ -73,7 +73,7 @@ def test_patched_errwindow(capfd, mocker, monkeypatch):
monkeypatch.setattr(checkpyver.sys, 'exit', lambda status: None) monkeypatch.setattr(checkpyver.sys, 'exit', lambda status: None)
try: try:
import tkinter # pylint: disable=unused-variable import tkinter
except ImportError: except ImportError:
tk_mock = mocker.patch('qutebrowser.misc.checkpyver.Tk', tk_mock = mocker.patch('qutebrowser.misc.checkpyver.Tk',
spec=['withdraw'], new_callable=mocker.Mock) spec=['withdraw'], new_callable=mocker.Mock)

View File

@ -463,9 +463,7 @@ class TestPreventExceptions:
def test_raising(self, caplog): def test_raising(self, caplog):
"""Test with a raising function.""" """Test with a raising function."""
with caplog.at_level(logging.ERROR, 'misc'): with caplog.at_level(logging.ERROR, 'misc'):
# pylint: disable=assignment-from-no-return
ret = self.func_raising() ret = self.func_raising()
# pylint: enable=assignment-from-no-return
assert ret == 42 assert ret == 42
expected = 'Error in test_utils.TestPreventExceptions.func_raising' expected = 'Error in test_utils.TestPreventExceptions.func_raising'
assert caplog.messages == [expected] assert caplog.messages == [expected]
@ -488,9 +486,7 @@ class TestPreventExceptions:
def test_predicate_true(self, caplog): def test_predicate_true(self, caplog):
"""Test with a True predicate.""" """Test with a True predicate."""
with caplog.at_level(logging.ERROR, 'misc'): with caplog.at_level(logging.ERROR, 'misc'):
# pylint: disable=assignment-from-no-return
ret = self.func_predicate_true() ret = self.func_predicate_true()
# enable: disable=assignment-from-no-return
assert ret == 42 assert ret == 42
assert len(caplog.records) == 1 assert len(caplog.records) == 1