@@ -86,12 +86,12 @@ class UnityTestCase(AutopilotTestCase):
86 @classmethod
86 @classmethod
87 def setUpClass(cls):
87 def setUpClass(cls):
89− output = subprocess.check_output([
89+ output = subprocess.check_output(
90− "/sbin/initctl",
90+ ["/sbin/initctl", "status", "unity8"],
93− ], stderr=subprocess.STDOUT)
91+ stderr=subprocess.STDOUT,
92+ universal_newlines=True,
94− except subprocess.CalledProcessError, e:
94+ except subprocess.CalledProcessError as e:
95 sys.stderr.write(
95 sys.stderr.write(
96 "Error: `initctl status unity8` failed, most probably the "
96 "Error: `initctl status unity8` failed, most probably the "
97 "unity8 session could not be found:\n\n"
97 "unity8 session could not be found:\n\n"
@@ -219,12 +219,11 @@ class UnityTestCase(AutopilotTestCase):
219 def _patch_environment(self, key, value):
219 def _patch_environment(self, key, value):
220 """Wrapper for patching env for upstart environment."""
220 """Wrapper for patching env for upstart environment."""
222− current_value = subprocess.check_output([
222+ current_value = subprocess.check_output(
223− "/sbin/initctl",
223+ ["/sbin/initctl", "get-env", "--global", key],
227− ], stderr=subprocess.STDOUT).rstrip()
224+ stderr=subprocess.STDOUT,
225+ universal_newlines=True,
228 except subprocess.CalledProcessError:
227 except subprocess.CalledProcessError:
229 current_value = None
228 current_value = None
@@ -299,7 +298,7 @@ class UnityTestCase(AutopilotTestCase):
300 def _launch_unity_with_upstart(self, binary_path, args):
299 def _launch_unity_with_upstart(self, binary_path, args):
301 logger.info("Starting unity")
300 logger.info("Starting unity")
302− self._patch_environment("QT_LOAD_TESTABILITY", 1)
301+ self._patch_environment(u"QT_LOAD_TESTABILITY", 1)
304 binary_arg = "BINARY=%s" % binary_path
303 binary_arg = "BINARY=%s" % binary_path
305 extra_args = "ARGS=%s" % " ".join(args)
304 extra_args = "ARGS=%s" % " ".join(args)
@@ -311,7 +310,7 @@ class UnityTestCase(AutopilotTestCase):
311 "unity8",
310 "unity8",
312 binary_arg,
311 binary_arg,
313 extra_args,
312 extra_args,
314− ] + ["%s=%s" % (k, v) for k, v in self._environment.iteritems()],
313+ ] + ["%s=%s" % (k, v) for k, v in self._environment.items()],
315 stderr=subprocess.STDOUT,
314 stderr=subprocess.STDOUT,