Skip to content

Commit 38c5242

Browse files
committed
Suppress SCF warning in tests
1 parent 627076f commit 38c5242

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/test_openmx_multiple_formats.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import numpy as np
66
from context import dpdata
7+
import warnings
78

89

910
class TestOPENMXTRAJProps:
@@ -49,12 +50,16 @@ def test_coord(self):
4950

5051
class TestOPENMXTraj(unittest.TestCase, TestOPENMXTRAJProps):
5152
def setUp(self):
52-
self.system = dpdata.System("openmx/Au111Surface", fmt="openmx/md")
53+
with warnings.catch_warnings():
54+
warnings.simplefilter("ignore", UserWarning)
55+
self.system = dpdata.System("openmx/Au111Surface", fmt="openmx/md")
5356

5457

5558
class TestOPENMXLabeledTraj(unittest.TestCase, TestOPENMXTRAJProps):
5659
def setUp(self):
57-
self.system = dpdata.LabeledSystem("openmx/Au111Surface", fmt="openmx/md")
60+
with warnings.catch_warnings():
61+
warnings.simplefilter("ignore", UserWarning)
62+
self.system = dpdata.LabeledSystem("openmx/Au111Surface", fmt="openmx/md")
5863

5964

6065
if __name__ == "__main__":

0 commit comments

Comments
 (0)