Commits

Sam Skillman committed e2d94c6

Only test the FieldValues once, not once for each projection direction. Swap out
the assert_rel_equal to the more forgiving (of comparing zeros) numpy.testing.assert_allclose.

Comments (0)

Files changed (2)

yt/frontends/enzo/answer_testing_support.py

     for field in fields:
         yield GridValuesTest(pf_fn, field)
         if 'particle' in field: continue
-        for axis in [0, 1, 2]:
-            for ds in dso:
+        for ds in dso:
+            for axis in [0, 1, 2]:
                 for weight_field in [None, "Density"]:
                     yield ProjectionValuesTest(
                         pf_fn, axis, field, weight_field,
                         ds, decimals=3)
-                yield FieldValuesTest(
-                        pf_fn, field, ds, decimals=3)
+            yield FieldValuesTest(
+                    pf_fn, field, ds, decimals=3)
                     
 class ShockTubeTest(object):
     def __init__(self, data_file, solution_file, fields, 

yt/utilities/answer_testing/framework.py

             assert_equal(new_result, old_result, 
                          err_msg=err_msg, verbose=True)
         else:
-            assert_rel_equal(new_result, old_result, self.decimals,
+            assert_allclose(new_result, old_result, 10.**(-self.decimals),
                              err_msg=err_msg, verbose=True)
 
 class AllFieldValuesTest(AnswerTestingTest):
                 assert_equal(new_result[k], old_result[k],
                              err_msg=err_msg)
             else:
-                assert_rel_equal(new_result[k], old_result[k], 
-                                 self.decimals, err_msg=err_msg)
+                assert_allclose(new_result[k], old_result[k], 
+                                 10.**-(self.decimals), err_msg=err_msg)
 
 class PixelizedProjectionValuesTest(AnswerTestingTest):
     _type_name = "PixelizedProjectionValues"