Switch to assert_allclose in test_dynmat_to_fc

This commit is contained in:
Paweł T. Jochym 2016-11-25 22:18:23 +01:00 committed by GitHub
parent 6ef61cc551
commit 25305c6c42
1 changed files with 3 additions and 2 deletions

View File

@ -31,8 +31,9 @@ class TestDynmatToFc(unittest.TestCase):
def _compare(self, comm_points, filename="comm_points.dat"):
with open(os.path.join(data_dir,filename)) as f:
comm_points_in_file = np.loadtxt(f)
self.assertTrue(
(np.abs(comm_points_in_file[:,1:] - comm_points) < 1e-3).all())
#self.assertTrue(
# (np.abs(comm_points_in_file[:,1:] - comm_points) < 1e-3).all())
np.testing.assert_allclose(comm_points_in_file[:,1:],comm_points,atol=1e-3)
def _write(self, comm_points, filename="comm_points.dat"):
with open(os.path.join(data_dir,filename), 'w') as w: