lint: Fix various small flake8 issues

This commit is contained in:
Florian Bruhin 2022-05-17 13:28:53 +02:00
parent 52f2b430e9
commit 21d9c9a585
5 changed files with 12 additions and 12 deletions

View File

@ -196,7 +196,7 @@ class WebEnginePage(QWebEnginePage):
if machinery.IS_QT5:
# Overridden method instead of signal
certificateError = _handle_certificate_error
certificateError = _handle_certificate_error # noqa: N815
def javaScriptConfirm(self, url, js_msg):
"""Override javaScriptConfirm to use qutebrowser prompts."""

View File

@ -120,8 +120,8 @@ def _apply_platform_markers(config, item):
pytest.mark.skipif,
not machinery.IS_QT6,
f"Only runs on Qt 6, not {machinery.WRAPPER}"),
('qt5_xfail', pytest.mark.xfail, machinery.IS_QT5, f"Fails on Qt 5"),
('qt6_xfail', pytest.mark.skipif, machinery.IS_QT6, f"Fails on Qt 6"),
('qt5_xfail', pytest.mark.xfail, machinery.IS_QT5, "Fails on Qt 5"),
('qt6_xfail', pytest.mark.skipif, machinery.IS_QT6, "Fails on Qt 6"),
]
for searched_marker, new_marker_kind, condition, default_reason in markers:

View File

@ -288,7 +288,7 @@ class TestWebEngineArgs:
# 'never' is handled via interceptor
('5.15.2', 'never', None),
('5.15.3', 'always', None),
('5.15.3', 'never', None),
# 'same-domain'
('5.15.2', 'same-domain', '--enable-features=ReducedReferrerGranularity'),

View File

@ -102,7 +102,7 @@ class FakeSocket(QObject):
readyRead = pyqtSignal() # noqa: N815
disconnected = pyqtSignal()
errorOccurred = pyqtSignal(QLocalSocket.LocalSocketError)
errorOccurred = pyqtSignal(QLocalSocket.LocalSocketError) # noqa: N815
def __init__(self, *, error=QLocalSocket.LocalSocketError.UnknownSocketError, state=None,
data=None, connect_successful=True, parent=None):

View File

@ -206,12 +206,12 @@ def test_ensure_valid(obj, raising, exc_reason, exc_str):
@pytest.mark.parametrize('status, raising, message', [
(QDataStream.Status.Ok, False, None),
(QDataStream.Status.ReadPastEnd, True, "The data stream has read past the end of "
"the data in the underlying device."),
(QDataStream.Status.ReadCorruptData, True, "The data stream has read corrupt "
"data."),
(QDataStream.Status.WriteFailed, True, "The data stream cannot write to the "
"underlying device."),
(QDataStream.Status.ReadPastEnd, True,
"The data stream has read past the end of the data in the underlying device."),
(QDataStream.Status.ReadCorruptData, True,
"The data stream has read corrupt data."),
(QDataStream.Status.WriteFailed, True,
"The data stream cannot write to the underlying device."),
])
def test_check_qdatastream(status, raising, message):
"""Test check_qdatastream.
@ -1058,7 +1058,7 @@ class TestLibraryPath:
except AttributeError:
enumtype = QLibraryInfo.LibraryLocation
our_names = set(member.value for member in qtutils.LibraryPath)
our_names = {member.value for member in qtutils.LibraryPath}
qt_names = set(testutils.enum_members(QLibraryInfo, enumtype))
qt_names.discard("ImportsPath") # Moved to QmlImportsPath in Qt 6
assert qt_names == our_names