diff --git a/tests/test_dialogs/test_dlg_docsplit.py b/tests/test_dialogs/test_dlg_docsplit.py index f24bf326..b0b4689d 100644 --- a/tests/test_dialogs/test_dlg_docsplit.py +++ b/tests/test_dialogs/test_dlg_docsplit.py @@ -56,6 +56,7 @@ def testDlgSplit_Main(qtbot, monkeypatch, nwGUI, projPath, mockRnd): ) hSplitDoc = project.newFile("Split Doc", C.hNovelRoot) + assert hSplitDoc is not None project.writeNewFile(hSplitDoc, 1, True, docText) projTree.revealNewTreeItem(hSplitDoc, nHandle=C.hNovelRoot, wordCount=True) diff --git a/tests/test_ext/test_ext_versioninfo.py b/tests/test_ext/test_ext_versioninfo.py index 14237fba..5dfb3f06 100644 --- a/tests/test_ext/test_ext_versioninfo.py +++ b/tests/test_ext/test_ext_versioninfo.py @@ -48,7 +48,8 @@ class MockDesktopServices: class MockData: - pass + def decode(self, *a): + return '{"tag_name": "v1.0"}' class MockPayload: @@ -61,14 +62,13 @@ class MockPayload: def read(self): data = MockData() - data.decode = lambda *a: '{"tag_name": "v1.0"}' return data class MockHTTPError: 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): return @@ -86,7 +86,7 @@ class MockException: @pytest.mark.gui def testExtVersionInfo_Main(qtbot, monkeypatch): """Test the VersionInfoWidget class.""" - version = VersionInfoWidget(None) + version = VersionInfoWidget(None) # type: ignore dialog = SimpleDialog(version) dialog.show() @@ -134,7 +134,7 @@ def testExtVersionInfo_Retriever(qtbot, monkeypatch): assert signal.args == ["v1.0", ""] def httpErr(): - raise HTTPError("http://example.com", 403, "Rate limit") + raise HTTPError("http://example.com", 403, "Rate limit") # type: ignore # HTTP Error with monkeypatch.context() as mp: