Fix remaining new flake8 issues
This commit is contained in:
parent
7c87f4e3d0
commit
2d996baea0
@ -91,15 +91,15 @@ def _parse_yaml_type(
|
||||
) -> configtypes.BaseType:
|
||||
if isinstance(node, str):
|
||||
# e.g:
|
||||
# type: Bool
|
||||
# > type: Bool
|
||||
# -> create the type object without any arguments
|
||||
type_name = node
|
||||
kwargs = {} # type: typing.MutableMapping[str, typing.Any]
|
||||
elif isinstance(node, dict):
|
||||
# e.g:
|
||||
# type:
|
||||
# name: String
|
||||
# none_ok: true
|
||||
# > type:
|
||||
# > name: String
|
||||
# > none_ok: true
|
||||
# -> create the type object and pass arguments
|
||||
type_name = node.pop('name')
|
||||
kwargs = node
|
||||
|
@ -31,7 +31,7 @@ except ImportError: # pragma: no cover
|
||||
try:
|
||||
# Python2
|
||||
from Tkinter import Tk # type: ignore
|
||||
import tkMessageBox as messagebox # type: ignore
|
||||
import tkMessageBox as messagebox # type: ignore # noqa: N813
|
||||
except ImportError:
|
||||
# Some Python without Tk
|
||||
Tk = None # type: ignore
|
||||
|
@ -40,7 +40,7 @@ from PyQt5.QtCore import (qVersion, QEventLoop, QDataStream, QByteArray,
|
||||
try:
|
||||
from PyQt5.QtWebKit import qWebKitVersion
|
||||
except ImportError: # pragma: no cover
|
||||
qWebKitVersion = None # type: ignore
|
||||
qWebKitVersion = None # type: ignore # noqa: N816
|
||||
|
||||
|
||||
MAXVALS = {
|
||||
|
@ -42,7 +42,7 @@ from PyQt5.QtWidgets import QApplication
|
||||
try:
|
||||
from PyQt5.QtWebKit import qWebKitVersion
|
||||
except ImportError: # pragma: no cover
|
||||
qWebKitVersion = None # type: ignore
|
||||
qWebKitVersion = None # type: ignore # noqa: N816
|
||||
|
||||
try:
|
||||
from PyQt5.QtWebEngineWidgets import QWebEngineProfile
|
||||
|
@ -41,7 +41,7 @@ def test_first_last_item(counts):
|
||||
cat = mock.Mock(spec=['layoutChanged', 'layoutAboutToBeChanged'])
|
||||
cat.rowCount = mock.Mock(return_value=c, spec=[])
|
||||
model.add_category(cat)
|
||||
data = [i for i, rowCount in enumerate(counts) if rowCount > 0]
|
||||
data = [i for i, row_count in enumerate(counts) if row_count > 0]
|
||||
if not data:
|
||||
# with no items, first and last should be an invalid index
|
||||
assert not model.first_item().isValid()
|
||||
|
@ -98,7 +98,7 @@ class FakeSocket(QObject):
|
||||
_connect_successful: The value returned for waitForConnected().
|
||||
"""
|
||||
|
||||
readyRead = pyqtSignal()
|
||||
readyRead = pyqtSignal() # noqa: N815
|
||||
disconnected = pyqtSignal()
|
||||
|
||||
def __init__(self, *, error=QLocalSocket.UnknownSocketError, state=None,
|
||||
|
Loading…
Reference in New Issue
Block a user