From 644f0c64c9c26523965ebb64f44a4dbcd99ae019 Mon Sep 17 00:00:00 2001 From: armando-migliaccio Date: Fri, 13 Sep 2013 07:44:40 -0700 Subject: [PATCH] Stop popen patch correctly in test_agent_linux_utils Fixes bug #1225009 Change-Id: Ic9f3491be2fb7481bbf3fd843a421d66d9248a20 --- neutron/tests/unit/test_agent_linux_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neutron/tests/unit/test_agent_linux_utils.py b/neutron/tests/unit/test_agent_linux_utils.py index 842c8a25f..cccbf2024 100644 --- a/neutron/tests/unit/test_agent_linux_utils.py +++ b/neutron/tests/unit/test_agent_linux_utils.py @@ -29,9 +29,9 @@ class AgentUtilsExecuteTest(base.BaseTestCase): self.test_file = self.useFixture( fixtures.TempDir()).join("test_execute.tmp") open(self.test_file, 'w').close() - instance = mock.patch("subprocess.Popen.communicate") - self.mock_popen = instance.start() - self.addCleanup(self.mock_popen.stop) + self.mock_popen_p = mock.patch("subprocess.Popen.communicate") + self.mock_popen = self.mock_popen_p.start() + self.addCleanup(self.mock_popen_p.stop) def test_without_helper(self): expected = "%s\n" % self.test_file -- 2.45.2