Skip to content

Commit 322c10c

Browse files
committed
opt code
1 parent 55193a7 commit 322c10c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_vasp_poscar_to_system.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ def test_move_flags(self):
2020

2121

2222
class TestPOSCARMoveFlags(unittest.TestCase):
23+
def setUp(self):
24+
self.tmp_file = "POSCAR.tmp.1"
25+
26+
def tearDown(self):
27+
if os.path.exists(self.tmp_file):
28+
os.remove(self.tmp_file)
2329
def test_move_flags_error1(self):
2430
with self.assertRaisesRegex(RuntimeError, "Invalid move flags.*?"):
2531
dpdata.System().from_vasp_poscar(os.path.join("poscars", "POSCAR.oh.err1"))
@@ -36,7 +42,7 @@ def test_move_flags_error3(self):
3642
with self.assertRaisesRegex(
3743
RuntimeError, "Invalid move flags:.*?should be a list of 3 bools"
3844
):
39-
system.to_vasp_poscar("POSCAR.tmp.1")
45+
system.to_vasp_poscar(self.tmp_file)
4046

4147

4248
class TestPOSCARDirect(unittest.TestCase, TestPOSCARoh):

0 commit comments

Comments
 (0)