@@ -22,6 +22,7 @@
23import signal
23import signal
24import subprocess
24import subprocess
26from testtools.matchers._basic import Equals
27from testtools.matchers._basic import Equals
27from autopilot.matchers import Eventually
28from autopilot.matchers import Eventually
@@ -49,7 +50,25 @@ class UpstartIntegrationTests(UnityTestCase):
49 def _launch_unity(self):
50 def _launch_unity(self):
50 self.patch_environment("QT_LOAD_TESTABILITY", "1")
51 self.patch_environment("QT_LOAD_TESTABILITY", "1")
51 self.process = subprocess.Popen([get_binary_path()] + self.unity_geometry_args)
52 self.process = subprocess.Popen([get_binary_path()] + self.unity_geometry_args)
53+ def ensure_stopped():
54+ self.process.terminate()
52− self.addCleanup(lambda: self.process.terminate())
71+ self.addCleanup(ensure_stopped)
54 def _set_proxy(self):
73 def _set_proxy(self):
55 super(UpstartIntegrationTests, self)._set_proxy(get_proxy_object_for_existing_process(
74 super(UpstartIntegrationTests, self)._set_proxy(get_proxy_object_for_existing_process(