From 6be7da03057aa26c3394733274ab33e7714b9fe5 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 28 Apr 2024 18:43:22 +0200 Subject: [PATCH] Clean up a few minor bits in the index tests --- tests/test_core/test_core_index.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_core/test_core_index.py b/tests/test_core/test_core_index.py index 23e58431..71f4bc5d 100644 --- a/tests/test_core/test_core_index.py +++ b/tests/test_core/test_core_index.py @@ -34,7 +34,7 @@ from novelwriter.core.project import NWProject from novelwriter.enum import nwComment, nwItemClass, nwItemLayout from tests.mocked import causeException -from tests.tools import C, buildTestProject, cmpFiles, writeFile +from tests.tools import C, buildTestProject, cmpFiles @pytest.mark.core @@ -123,12 +123,14 @@ def testCoreIndex_LoadSave(qtbot, monkeypatch, prjLipsum, mockGUI, tstPaths): assert cmpFiles(testFile, compFile) # Write an empty index file and load it - writeFile(projFile, "{}") + projFile.write_text("{}", encoding="utf-8") assert index.loadIndex() is False assert index.indexBroken is True # Write an index file that passes loading, but is still empty - writeFile(projFile, ('{"novelWriter.tagsIndex": {}, "novelWriter.itemIndex": {}}')) + projFile.write_text( + '{"novelWriter.tagsIndex": {}, "novelWriter.itemIndex": {}}', encoding="utf-8" + ) assert index.loadIndex() is True assert index.indexBroken is False