Skip to content
Snippets Groups Projects
Unverified Commit 54376cff authored by Xavier Robin's avatar Xavier Robin
Browse files

test: remove compound lib only after tests are complete

This fixes test_complib.py on mac
parent ea80f566
Branches
Tags
No related merge requests found
...@@ -14,13 +14,16 @@ class TestCompLib(unittest.TestCase): ...@@ -14,13 +14,16 @@ class TestCompLib(unittest.TestCase):
chemdict_tool_path = os.path.join(prefix_path, "bin", "chemdict_tool") chemdict_tool_path = os.path.join(prefix_path, "bin", "chemdict_tool")
if not os.path.exists(chemdict_tool_path): if not os.path.exists(chemdict_tool_path):
raise RuntimeError("Expect chemdict_tool:", chemdict_tool_path) raise RuntimeError("Expect chemdict_tool:", chemdict_tool_path)
tmp_dir = tempfile.TemporaryDirectory() cls.tmp_dir = tempfile.TemporaryDirectory()
compounds_path = os.path.join("testfiles", "test_compounds.cif") compounds_path = os.path.join("testfiles", "test_compounds.cif")
complib_path = os.path.join(tmp_dir.name, "test_complib.dat") complib_path = os.path.join(cls.tmp_dir.name, "test_complib.dat")
cmd = [chemdict_tool_path, "create", compounds_path, complib_path] cmd = [chemdict_tool_path, "create", compounds_path, complib_path]
subprocess.run(cmd) subprocess.run(cmd)
cls.complib = conop.CompoundLib.Load(complib_path) cls.complib = conop.CompoundLib.Load(complib_path)
tmp_dir.cleanup()
@classmethod
def tearDownClass(cls):
cls.tmp_dir.cleanup()
def test_three_vs_five_letter_code(self): def test_three_vs_five_letter_code(self):
complib = self.complib complib = self.complib
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment