diff options
author | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-06-11 10:58:37 +0100 |
---|---|---|
committer | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-06-11 10:26:01 +0000 |
commit | da7539acd6a3d7772f8152db09c2f80a344c4ece (patch) | |
tree | 35982c7300babe4c4ed4d9c8b43833fa3a61bf94 | |
parent | 98294f2c8153f663c3b3a4e4cb98910e9d5cb602 (diff) |
Cleanup process test cases
Remove logging console output during test execution.
JIRA: YARDSTICK-1234
Change-Id: I8ecab0219ffd1919f2fa97a90d5be11018b11322
Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
-rw-r--r-- | yardstick/tests/unit/common/test_process.py | 10 |
1 files changed, 6 insertions, 4 deletions
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, |