forked from GitHub/gf-core
remove basic.ngf when starting test since on Windows we cannot remove files that are still open
This commit is contained in:
@@ -6,6 +6,11 @@ from pgf import *
|
|||||||
|
|
||||||
pgf_path = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))+"/haskell/tests/"
|
pgf_path = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))+"/haskell/tests/"
|
||||||
|
|
||||||
|
try:
|
||||||
|
os.remove("./basic.ngf")
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
# readPGF
|
# readPGF
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
@@ -28,9 +33,7 @@ def test_readPGF_NGF(NGF):
|
|||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
def NGF():
|
def NGF():
|
||||||
ngf = bootNGF(pgf_path+"basic.pgf", "./basic.ngf")
|
return bootNGF(pgf_path+"basic.pgf", "./basic.ngf")
|
||||||
yield ngf
|
|
||||||
os.remove("./basic.ngf")
|
|
||||||
|
|
||||||
def test_bootNGF_non_existent():
|
def test_bootNGF_non_existent():
|
||||||
with pytest.raises(FileNotFoundError):
|
with pytest.raises(FileNotFoundError):
|
||||||
|
|||||||
Reference in New Issue
Block a user