From f7366cb2ff279d83cbf1e27061e7f20d31730a6a Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 17 Jul 2025 19:47:46 +0200 Subject: [PATCH] Fix linting errors for new rules --- tests/test_gui/test_gui_guimain.py | 8 ++++---- tests/test_gui/test_gui_theme.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_gui/test_gui_guimain.py b/tests/test_gui/test_gui_guimain.py index 3940cbba..1ebfa42c 100644 --- a/tests/test_gui/test_gui_guimain.py +++ b/tests/test_gui/test_gui_guimain.py @@ -827,13 +827,13 @@ def testGuiMain_OpenClose(qtbot, monkeypatch, nwGUI, projPath, fncPath, mockRnd) # Handle broken index on project open nwGUI.closeProject() idxPath: Path = projPath / "meta" / nwFiles.INDEX_FILE - assert idxPath.read_text() != "{}" - idxPath.write_text("{}") - assert idxPath.read_text() == "{}" + assert idxPath.read_text(encoding="utf-8") != "{}" + idxPath.write_text("{}", encoding="utf-8") + assert idxPath.read_text(encoding="utf-8") == "{}" nwGUI.openProject(projPath) nwGUI.saveProject() - assert idxPath.read_text() != "{}" + assert idxPath.read_text(encoding="utf-8") != "{}" assert nwGUI.docEditor.docHandle == C.hSceneDoc assert nwGUI.docViewer.docHandle == C.hTitlePage diff --git a/tests/test_gui/test_gui_theme.py b/tests/test_gui/test_gui_theme.py index 49c6c92c..68b75fd4 100644 --- a/tests/test_gui/test_gui_theme.py +++ b/tests/test_gui/test_gui_theme.py @@ -213,7 +213,7 @@ def testGuiTheme_SpecialColors(tstPaths): theme.iconCache = MagicMock() testTheme: Path = tstPaths.cnfDir / "themes" / "test.conf" - testTheme.write_text( + testTheme.write_text(( "[Main]\n" "name = Test\n" "mode = light\n" @@ -241,7 +241,7 @@ def testGuiTheme_SpecialColors(tstPaths): "[Palette]\n" "window = #000000\n" "text = #ffffff\n" - ) + ), encoding="utf-8") theme._scanThemes([testTheme]) assert len(theme.colourThemes) == 1 CONFIG.themeMode = nwTheme.LIGHT