From da7539acd6a3d7772f8152db09c2f80a344c4ece Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Mon, 11 Jun 2018 10:58:37 +0100 Subject: Cleanup process test cases Remove logging console output during test execution. JIRA: YARDSTICK-1234 Change-Id: I8ecab0219ffd1919f2fa97a90d5be11018b11322 Signed-off-by: Rodolfo Alonso Hernandez --- yardstick/tests/unit/common/test_process.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'yardstick/tests/unit/common/test_process.py') diff --git a/yardstick/tests/unit/common/test_process.py b/yardstick/tests/unit/common/test_process.py index 1c6dfec27..e0933c6ac 100644 --- a/yardstick/tests/unit/common/test_process.py +++ b/yardstick/tests/unit/common/test_process.py @@ -90,10 +90,11 @@ class ExecuteTestCase(unittest.TestCase): additional_env=self.additional_env) self.assertEqual(self.stdout, out) - def test_execute_exception(self): + @mock.patch.object(process, 'LOG') + def test_execute_exception(self, *args): self.obj.returncode = self.RET_CODE_WRONG - self.assertRaises(exceptions.ProcessExecutionError, process.execute, - self.input_cmd, additional_env=self.additional_env) + with self.assertRaises(exceptions.ProcessExecutionError): + process.execute(self.input_cmd, additional_env=self.additional_env) self.obj.communicate.assert_called_once_with(None) def test_execute_with_extra_code(self): @@ -107,7 +108,8 @@ class ExecuteTestCase(unittest.TestCase): additional_env=self.additional_env) self.assertEqual(self.stdout, out) - def test_execute_exception_no_check(self): + @mock.patch.object(process, 'LOG') + def test_execute_exception_no_check(self, *args): self.obj.returncode = self.RET_CODE_WRONG out = process.execute(self.input_cmd, additional_env=self.additional_env, -- cgit 1.2.3-korg