]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Stop popen patch correctly in test_agent_linux_utils
authorarmando-migliaccio <amigliaccio@nicira.com>
Fri, 13 Sep 2013 14:44:40 +0000 (07:44 -0700)
committerarmando-migliaccio <amigliaccio@nicira.com>
Fri, 13 Sep 2013 14:44:40 +0000 (07:44 -0700)
Fixes bug #1225009

Change-Id: Ic9f3491be2fb7481bbf3fd843a421d66d9248a20

neutron/tests/unit/test_agent_linux_utils.py

index 842c8a25f062a1646fc20071947f3b382d7463d0..cccbf2024f622f4e0872dea9061ecb91a10a7490 100644 (file)
@@ -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