remove basic.ngf when starting test since on Windows we cannot remove files that are still open

This commit is contained in:
Krasimir Angelov
2023-01-27 17:01:34 +01:00
parent 1e3eb44843
commit cd3372de35

View File

@@ -6,6 +6,11 @@ from pgf import *
pgf_path = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))+"/haskell/tests/"
try:
os.remove("./basic.ngf")
except:
pass
# readPGF
@pytest.fixture(scope="module")
@@ -28,9 +33,7 @@ def test_readPGF_NGF(NGF):
@pytest.fixture(scope="module")
def NGF():
ngf = bootNGF(pgf_path+"basic.pgf", "./basic.ngf")
yield ngf
os.remove("./basic.ngf")
return bootNGF(pgf_path+"basic.pgf", "./basic.ngf")
def test_bootNGF_non_existent():
with pytest.raises(FileNotFoundError):