From dd9ad9c77d97e4e44047f02e8f3860ce5b4e6255 Mon Sep 17 00:00:00 2001 From: Shanqing Cai Date: Sun, 17 Sep 2017 20:11:29 -0400 Subject: [PATCH] Fix test breakage on Mac Python3 due to assert_called() Replace assert_called() with self.assertTrue and called(). --- tensorflow/python/estimator/training_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/python/estimator/training_test.py b/tensorflow/python/estimator/training_test.py index 2497db038ba..899ba30a1e8 100644 --- a/tensorflow/python/estimator/training_test.py +++ b/tensorflow/python/estimator/training_test.py @@ -237,7 +237,7 @@ class _TrainingExecutorTrainingTest(object): config=test.mock.ANY, start=False) - mock_server_instance.start.assert_called() + self.assertTrue(mock_server_instance.start.called) mock_est.train.assert_called_with(input_fn=train_spec.input_fn, max_steps=train_spec.max_steps, @@ -349,7 +349,7 @@ class TrainingExecutorRunWorkerTest(_TrainingExecutorTrainingTest, with test.mock.patch.object(time, 'sleep') as mock_sleep: mock_sleep.side_effect = lambda s: self.assertEqual(expected_secs, s) self._run_task(executor) - mock_sleep.assert_called() + self.assertTrue(mock_sleep.called) class TrainingExecutorRunChiefTest(_TrainingExecutorTrainingTest,