diff options
Diffstat (limited to 'tensorflow/python/framework/test_util_test.py')
-rw-r--r-- | tensorflow/python/framework/test_util_test.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tensorflow/python/framework/test_util_test.py b/tensorflow/python/framework/test_util_test.py index c4f8fa9108..22189afa59 100644 --- a/tensorflow/python/framework/test_util_test.py +++ b/tensorflow/python/framework/test_util_test.py @@ -268,6 +268,11 @@ class TestUtilTest(test_util.TensorFlowTestCase): self.assertAllClose(7, 7 + 1e-5) @test_util.run_in_graph_and_eager_modes + def testAllCloseList(self): + with self.assertRaisesRegexp(AssertionError, r"not close dif"): + self.assertAllClose([0], [1]) + + @test_util.run_in_graph_and_eager_modes def testAllCloseDictToNonDict(self): with self.assertRaisesRegexp(ValueError, r"Can't compare dict to non-dict"): self.assertAllClose(1, {"a": 1}) @@ -452,6 +457,9 @@ class TestUtilTest(test_util.TensorFlowTestCase): self.assertAllEqual([120] * 3, k) self.assertAllEqual([20] * 3, j) + with self.assertRaisesRegexp(AssertionError, r"not equal lhs"): + self.assertAllEqual([0] * 3, k) + @test_util.run_in_graph_and_eager_modes def testAssertNotAllClose(self): # Test with arrays |