Updated tests and added a better way to save temp files

This commit is contained in:
Veronica K. B. Olsen
2019-05-18 15:02:58 +02:00
parent 19b2521b73
commit 2768c46976
11 changed files with 111 additions and 80 deletions
+36
View File
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
"""novelWriter Test Config
"""
import pytest, shutil
from os import path, mkdir
@pytest.fixture(scope="session")
def nwTemp():
testDir = path.dirname(__file__)
tempDir = path.join(testDir,"temp")
if path.isdir(tempDir):
shutil.rmtree(tempDir)
if not path.isdir(tempDir):
mkdir(tempDir)
return tempDir
@pytest.fixture(scope="session")
def nwTempProj(nwTemp):
projDir = path.join(nwTemp,"proj")
if not path.isdir(projDir):
mkdir(projDir)
return projDir
@pytest.fixture(scope="session")
def nwTempGUI(nwTemp):
guiDir = path.join(nwTemp,"gui")
if not path.isdir(guiDir):
mkdir(guiDir)
return guiDir
@pytest.fixture(scope="session")
def nwRef():
testDir = path.dirname(__file__)
refDir = path.join(testDir,"reference")
return refDir