on xenial help sign in
More flake8 fixes.
commit9821ade1355f9322ba0efdca7a065ea41190ff2c authorLeo Arias <leo.arias@canonical.com> dateFri 27 Jun 2014, 07:13 (12 years ago) parent570ac2d
3 files changed+18−11
.bazaar/plugins/makecheck_unity_phablet.py+16−8 tests/autopilot/unity8/process_helpers.py+1−1 tests/autopilot/unity8/shell/tests/__init__.py+1−2
.bazaar/plugins/makecheck_unity_phablet.py+16−8
@@ -1,5 +1,5 @@
11#!/usr/bin/python
2−# Copyright 2013 Canonical Ltd.
2+# Copyright 2013, 2014 Canonical Ltd.
33#
44# This program is free software; you can redistribute it and/or modify
55# it under the terms of the GNU Lesser General Public License as published by
@@ -13,11 +13,15 @@
1313# You should have received a copy of the GNU Lesser General Public License
1414# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515
16−import os, subprocess
17−from bzrlib import branch, errors
18−from bzrlib.urlutils import dirname, local_path_from_url
16+import os
17+import subprocess
18+from bzrlib import branch
19+from bzrlib.urlutils import local_path_from_url
1920
20−def execute_makecheck(local_branch, master_branch, old_revision_number, old_revision_id, future_revision_number, future_revision_id, tree_delta, future_tree):
21+
22+def execute_makecheck(
23+ local_branch, master_branch, old_revision_number, old_revision_id,
24+ future_revision_number, future_revision_id, tree_delta, future_tree):
2125 if not master_branch.basis_tree().has_filename("qml/Shell.qml"):
2226 return
2327
@@ -27,7 +31,9 @@ def execute_makecheck(local_branch, master_branch, old_revision_number, old_revi
2731 os.environ['CTEST_OUTPUT_ON_FAILURE'] = "1"
2832 if (subprocess.call("make -C builddir test", shell=True) != 0):
2933
30− print("\n\n*** Warning ***\n\nBasic tests failed. This commit will not pass continuous integration.")
34+ print("\n\n*** Warning ***\n\n"
35+ "Basic tests failed. This commit will not pass continuous "
36+ "integration.")
3137
3238 branch = local_branch or master_branch
3339 revision = branch.repository.get_revision(future_revision_id)
@@ -36,8 +42,10 @@ def execute_makecheck(local_branch, master_branch, old_revision_number, old_revi
3642 msg_file.close()
3743
3844 print("\n\nSaved commit message to $SRC_DIR/message.txt.")
39− print("You can uncommit this revision, fix the tests and reuse your message running:\n\nbzr commit -F message.txt\n\n")
45+ print("You can uncommit this revision, fix the tests and reuse your "
46+ "message running:\n\nbzr commit -F message.txt\n\n")
4047 elif os.path.isfile("message.txt"):
4148 os.remove("message.txt")
4249
43−branch.Branch.hooks.install_named_hook('pre_commit', execute_makecheck, 'make check pre-commit')
50+branch.Branch.hooks.install_named_hook(
51+ 'pre_commit', execute_makecheck, 'make check pre-commit')
tests/autopilot/unity8/process_helpers.py+1−1
@@ -173,7 +173,7 @@ def _get_unity_status():
173173
174174def _get_unity_pid():
175175 status = _get_unity_status()
176− if not "start/" in status:
176+ if "start/" not in status:
177177 raise CannotAccessUnity("Unity is not in the running state.")
178178 return int(status.split()[-1])
179179
tests/autopilot/unity8/shell/tests/__init__.py+1−2
@@ -142,12 +142,11 @@ class UnityTestCase(AutopilotTestCase):
142142 self._data_dirs_mock_enabled = True
143143 self._environment = {}
144144
145− #### FIXME: This is a work around re: lp:1238417 ####
145+ # FIXME: This is a work around re: lp:1238417
146146 if model() != "Desktop":
147147 from autopilot.input import _uinput
148148 _uinput._touch_device = _uinput.create_touch_device()
149149 self.addCleanup(_uinput._touch_device.close)
150− ####
151150
152151 self.touch = Touch.create()
153152 self._setup_display_details()