@@ -25,7 +25,8 @@ import signal
2525import subprocess
2626import time
2727
28−from testtools.matchers._basic import Equals
28+import fixtures
29+from testtools.matchers import Equals, MismatchError
2930from autopilot.matchers import Eventually
3031from autopilot.introspection import get_proxy_object_for_existing_process
3132
@@ -100,8 +101,21 @@ class UpstartIntegrationTests(UnityTestCase):
100101 emulator_base=UnityEmulatorBase,))
101102
102103 def test_no_sigstop(self):
103− self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "")
104+ self.useFixture(
105+ fixtures.EnvironmentVariable(
106+ 'UNITY_MIR_EMITS_SIGSTOP', newvalue=None))
104107 self._launch_unity()
108+
109+ try:
110+ self.assertThat(
111+ lambda: os.WIFSTOPPED(self._get_status()),
112+ Eventually(Equals(True)))
113+ except MismatchError:
114+ pass
115+ else:
116+ self.process.send_signal(signal.SIGCONT)
117+ self.fail('Unity8 raised SIGSTOP')
118+
105119 self._set_proxy()
106120
107121 logger.debug("Unity started, waiting for it to be ready.")
@@ -109,7 +123,8 @@ class UpstartIntegrationTests(UnityTestCase):
109123 logger.debug("Unity loaded and ready.")
110124
111125 def test_expect_sigstop(self):
112− self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "1")
126+ self.useFixture(
127+ fixtures.EnvironmentVariable('UNITY_MIR_EMITS_SIGSTOP', '1'))
113128 self._launch_unity()
114129 self.assertThat(
115130 lambda: os.WIFSTOPPED(self._get_status()),