Merge lp:~robru/unity8/autopilot-py3k into lp:unity8

Proposed by Robert Bruce Park on 2013-11-13
Status: Rejected
Rejected by: Robert Bruce Park on 2013-11-14
Proposed branch: lp:~robru/unity8/autopilot-py3k
Merge into: lp:unity8
Diff against target: 68 lines (+12/-5)
4 files modified
tests/autopilot/unity8/shell/emulators/create_interactive_notification.py (+1/-1)
tests/autopilot/unity8/shell/tests/__init__.py (+2/-2)
tests/autopilot/unity8/shell/tests/test_lock_screen.py (+8/-1)
tests/autopilot/unity8/shell/tests/test_notifications.py (+1/-1)
To merge this branch: bzr merge lp:~robru/unity8/autopilot-py3k
Reviewer Review Type Date Requested Status
Christopher Lee (community) 2013-11-13 Disapprove on 2013-11-14
Review via email: mp+195128@code.launchpad.net

Commit message

Python 3 fixes.

To post a comment you must log in.
lp:~robru/unity8/autopilot-py3k updated on 2013-11-13
522. By Robert Bruce Park on 2013-11-13

More robust handling of basestring. Compatible with python 2 & 3.

523. By Robert Bruce Park on 2013-11-13

Bring back __future__ imports, which are harmless in Python 3.

Christopher Lee (veebers) wrote :

Disapproving as discussed in #ubuntu-unity in favour of this branch: https://code.launchpad.net/~veebers/unity8/update_ap_tests_ready_for_py3/+merge/194655

review: Disapprove

Unmerged revisions

523. By Robert Bruce Park on 2013-11-13

Bring back __future__ imports, which are harmless in Python 3.

522. By Robert Bruce Park on 2013-11-13

More robust handling of basestring. Compatible with python 2 & 3.

521. By Robert Bruce Park on 2013-11-13

Python 3 fixes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/unity8/shell/emulators/create_interactive_notification.py'
2--- tests/autopilot/unity8/shell/emulators/create_interactive_notification.py 2013-10-29 21:45:53 +0000
3+++ tests/autopilot/unity8/shell/emulators/create_interactive_notification.py 2013-11-13 20:47:23 +0000
4@@ -25,7 +25,7 @@
5
6
7 def action_callback(notification, action_id, data):
8- print action_id
9+ print(action_id)
10
11
12 def quit_callback(notification):
13
14=== modified file 'tests/autopilot/unity8/shell/tests/__init__.py'
15--- tests/autopilot/unity8/shell/tests/__init__.py 2013-11-01 13:59:50 +0000
16+++ tests/autopilot/unity8/shell/tests/__init__.py 2013-11-13 20:47:23 +0000
17@@ -91,7 +91,7 @@
18 "status",
19 "unity8"
20 ], stderr=subprocess.STDOUT)
21- except subprocess.CalledProcessError, e:
22+ except subprocess.CalledProcessError as e:
23 sys.stderr.write(
24 "Error: `initctl status unity8` failed, most probably the "
25 "unity8 session could not be found:\n\n"
26@@ -311,7 +311,7 @@
27 "unity8",
28 binary_arg,
29 extra_args,
30- ] + ["%s=%s" % (k, v) for k, v in self._environment.iteritems()],
31+ ] + ["%s=%s" % (k, v) for k, v in self._environment.items()],
32 stderr=subprocess.STDOUT,
33 )
34
35
36=== modified file 'tests/autopilot/unity8/shell/tests/test_lock_screen.py'
37--- tests/autopilot/unity8/shell/tests/test_lock_screen.py 2013-08-23 07:38:56 +0000
38+++ tests/autopilot/unity8/shell/tests/test_lock_screen.py 2013-11-13 20:47:23 +0000
39@@ -31,8 +31,15 @@
40
41 logger = logging.getLogger(__name__)
42
43+
44+try:
45+ basestring = basestring
46+except NameError:
47+ # must be Python 3
48+ basestring = (str,bytes)
49+
50+
51 class TestLockscreen(UnityTestCase):
52-
53 """Tests for the lock screen."""
54
55 scenarios = _get_device_emulation_scenarios()
56
57=== modified file 'tests/autopilot/unity8/shell/tests/test_notifications.py'
58--- tests/autopilot/unity8/shell/tests/test_notifications.py 2013-11-01 13:59:50 +0000
59+++ tests/autopilot/unity8/shell/tests/test_notifications.py 2013-11-13 20:47:23 +0000
60@@ -303,7 +303,7 @@
61 if self._notify_proc is None:
62 raise AssertionError("No interactive notification was created.")
63
64- for i in xrange(timeout):
65+ for i in range(timeout):
66 self._notify_proc.poll()
67 if self._notify_proc.returncode is not None:
68 output = self._notify_proc.communicate()

Subscribers

People subscribed via source and target branches