diff --git a/tensorflow/python/kernel_tests/confusion_matrix_test.py b/tensorflow/python/kernel_tests/confusion_matrix_test.py index c1178253a4b..810d2e60961 100644 --- a/tensorflow/python/kernel_tests/confusion_matrix_test.py +++ b/tensorflow/python/kernel_tests/confusion_matrix_test.py @@ -188,7 +188,7 @@ class ConfusionMatrixTest(test.TestCase): def testLabelsTooLarge(self): labels = np.asarray([1, 1, 0, 3, 5], dtype=np.int32) predictions = np.asarray([2, 1, 0, 2, 2], dtype=np.int32) - with self.assertRaisesOpError("`labels`.*x < y"): + with self.assertRaisesOpError("`labels`[\s\S]*x < y"): self._testConfMatrix( labels=labels, predictions=predictions, num_classes=3, truth=None) @@ -203,7 +203,7 @@ class ConfusionMatrixTest(test.TestCase): def testPredictionsTooLarge(self): labels = np.asarray([1, 1, 0, 2, 2], dtype=np.int32) predictions = np.asarray([2, 1, 0, 3, 5], dtype=np.int32) - with self.assertRaisesOpError("`predictions`.*x < y"): + with self.assertRaisesOpError("`predictions`[\s\S]*x < y"): self._testConfMatrix( labels=labels, predictions=predictions, num_classes=3, truth=None)