Change confPath to a Path object

This commit is contained in:
Veronica Berglyd Olsen
2022-11-09 00:09:40 +01:00
parent 9500c3bdb2
commit 6f5539de90
5 changed files with 44 additions and 72 deletions
+10 -10
View File
@@ -158,28 +158,28 @@ def fncProj(fncDir):
##
@pytest.fixture(scope="function")
def tmpConf(tmpDir):
def tmpConf(tmpPath):
"""Create a temporary novelWriter configuration object.
"""
confFile = os.path.join(tmpDir, "novelwriter.conf")
if os.path.isfile(confFile):
os.unlink(confFile)
confFile = tmpPath / "novelwriter.conf"
if confFile.is_file():
confFile.unlink()
theConf = Config()
theConf.initConfig(tmpDir, tmpDir)
theConf.initConfig(tmpPath, str(tmpPath))
theConf.setLastPath("")
theConf.guiLang = "en_GB"
return theConf
@pytest.fixture(scope="function")
def fncConf(fncDir):
def fncConf(fncPath):
"""Create a temporary novelWriter configuration object.
"""
confFile = os.path.join(fncDir, "novelwriter.conf")
if os.path.isfile(confFile):
os.unlink(confFile)
confFile = fncPath / "novelwriter.conf"
if confFile.is_file():
confFile.unlink()
theConf = Config()
theConf.initConfig(fncDir, fncDir)
theConf.initConfig(fncPath, str(fncPath))
theConf.setLastPath("")
theConf.guiLang = "en_GB"
return theConf