From 81c7477a55b509a33af38bc502b1e9dd4ea643ff Mon Sep 17 00:00:00 2001 From: Ryan Harper Date: Mon, 10 Feb 2020 10:17:56 -0600 Subject: unittest: fix stderr leak in cc_set_password random unittest output. (#208) --- cloudinit/config/tests/test_set_passwords.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cloudinit') diff --git a/cloudinit/config/tests/test_set_passwords.py b/cloudinit/config/tests/test_set_passwords.py index 3b5cdd06..8247c388 100644 --- a/cloudinit/config/tests/test_set_passwords.py +++ b/cloudinit/config/tests/test_set_passwords.py @@ -74,6 +74,10 @@ class TestSetPasswordsHandle(CiTestCase): with_logs = True + def setUp(self): + super(TestSetPasswordsHandle, self).setUp() + self.add_patch('cloudinit.config.cc_set_passwords.sys.stderr', 'm_err') + def test_handle_on_empty_config(self, *args): """handle logs that no password has changed when config is empty.""" cloud = self.tmp_cloud(distro='ubuntu') -- cgit v1.2.3