From f1d8265a02ae412d27b9ec3695c5a738387d2366 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 1 Oct 2020 20:44:52 +0200 Subject: [PATCH] A couple of fixes to tests breaking on windows and mac --- nw/__init__.py | 2 +- tests/test_dialogs.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/nw/__init__.py b/nw/__init__.py index eca0e5ee..8419dd81 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -203,7 +203,7 @@ def main(sysArgs=None): if not logFile == "" and toFile: if os.path.isfile(logFile+".bak"): - os.remove(logFile+".bak") + os.unlink(logFile+".bak") if os.path.isfile(logFile): os.rename(logFile, logFile+".bak") diff --git a/tests/test_dialogs.py b/tests/test_dialogs.py index a71653ee..9fa4c531 100644 --- a/tests/test_dialogs.py +++ b/tests/test_dialogs.py @@ -540,12 +540,16 @@ def testBuildTool(qtbot, yesToAll, nwTempBuild, nwLipsum, nwRef, nwTemp): # We assume the export itself by the Qt library works, so we just # check that novelWriter successfully writes the files. assert nwBuild._saveDocument(nwBuild.FMT_ODT) - assert nwBuild._saveDocument(nwBuild.FMT_PDF) - assert nwBuild._saveDocument(nwBuild.FMT_MD) - assert nwBuild._saveDocument(nwBuild.FMT_TXT) assert os.path.isfile(os.path.join(nwLipsum, "Lorem Ipsum.odt")) - assert os.path.isfile(os.path.join(nwLipsum, "Lorem Ipsum.pdf")) + + if not nwGUI.mainConf.osDarwin: + assert nwBuild._saveDocument(nwBuild.FMT_PDF) + assert os.path.isfile(os.path.join(nwLipsum, "Lorem Ipsum.pdf")) + + assert nwBuild._saveDocument(nwBuild.FMT_MD) assert os.path.isfile(os.path.join(nwLipsum, "Lorem Ipsum.md")) + + assert nwBuild._saveDocument(nwBuild.FMT_TXT) assert os.path.isfile(os.path.join(nwLipsum, "Lorem Ipsum.txt")) # Close the build tool