Clean up some linting errors
This commit is contained in:
@@ -56,6 +56,7 @@ def testDlgSplit_Main(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
|
|||||||
)
|
)
|
||||||
|
|
||||||
hSplitDoc = project.newFile("Split Doc", C.hNovelRoot)
|
hSplitDoc = project.newFile("Split Doc", C.hNovelRoot)
|
||||||
|
assert hSplitDoc is not None
|
||||||
project.writeNewFile(hSplitDoc, 1, True, docText)
|
project.writeNewFile(hSplitDoc, 1, True, docText)
|
||||||
projTree.revealNewTreeItem(hSplitDoc, nHandle=C.hNovelRoot, wordCount=True)
|
projTree.revealNewTreeItem(hSplitDoc, nHandle=C.hNovelRoot, wordCount=True)
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ class MockDesktopServices:
|
|||||||
|
|
||||||
|
|
||||||
class MockData:
|
class MockData:
|
||||||
pass
|
def decode(self, *a):
|
||||||
|
return '{"tag_name": "v1.0"}'
|
||||||
|
|
||||||
|
|
||||||
class MockPayload:
|
class MockPayload:
|
||||||
@@ -61,14 +62,13 @@ class MockPayload:
|
|||||||
|
|
||||||
def read(self):
|
def read(self):
|
||||||
data = MockData()
|
data = MockData()
|
||||||
data.decode = lambda *a: '{"tag_name": "v1.0"}'
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
class MockHTTPError:
|
class MockHTTPError:
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
raise HTTPError("http://example.com", 403, "Rate limit", None, None)
|
raise HTTPError("http://example.com", 403, "Rate limit", None, None) # type: ignore
|
||||||
|
|
||||||
def __exit__(self, *args):
|
def __exit__(self, *args):
|
||||||
return
|
return
|
||||||
@@ -86,7 +86,7 @@ class MockException:
|
|||||||
@pytest.mark.gui
|
@pytest.mark.gui
|
||||||
def testExtVersionInfo_Main(qtbot, monkeypatch):
|
def testExtVersionInfo_Main(qtbot, monkeypatch):
|
||||||
"""Test the VersionInfoWidget class."""
|
"""Test the VersionInfoWidget class."""
|
||||||
version = VersionInfoWidget(None)
|
version = VersionInfoWidget(None) # type: ignore
|
||||||
dialog = SimpleDialog(version)
|
dialog = SimpleDialog(version)
|
||||||
dialog.show()
|
dialog.show()
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ def testExtVersionInfo_Retriever(qtbot, monkeypatch):
|
|||||||
assert signal.args == ["v1.0", ""]
|
assert signal.args == ["v1.0", ""]
|
||||||
|
|
||||||
def httpErr():
|
def httpErr():
|
||||||
raise HTTPError("http://example.com", 403, "Rate limit")
|
raise HTTPError("http://example.com", 403, "Rate limit") # type: ignore
|
||||||
|
|
||||||
# HTTP Error
|
# HTTP Error
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
|
|||||||
Reference in New Issue
Block a user