Merge lp:~brandontschaefer/unity/python3-start-moving-over-AP-tests into lp:unity

Proposed by Brandon Schaefer
Status: Work in progress
Proposed branch: lp:~brandontschaefer/unity/python3-start-moving-over-AP-tests
Merge into: lp:unity
Diff against target: 87 lines (+7/-8)
6 files modified
tests/autopilot/unity/emulators/X11.py (+1/-1)
tests/autopilot/unity/emulators/compiz.py (+1/-2)
tests/autopilot/unity/emulators/hud.py (+1/-1)
tests/autopilot/unity/tests/test_gnome_key_grabber.py (+1/-1)
tests/autopilot/unity/tests/test_ibus.py (+1/-1)
tests/autopilot/unity/tests/test_shopping_lens.py (+2/-2)
To merge this branch: bzr merge lp:~brandontschaefer/unity/python3-start-moving-over-AP-tests
Reviewer Review Type Date Requested Status
Christopher Townsend (community) Needs Fixing
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+213931@code.launchpad.net

Commit message

A few simple changes, as we need to start moving our AP tests over to python3.

Description of the change

A few simple changes, as we need to start moving our AP tests over to python3.

The next largest hurdle will be getting compizconfig python3 compliant....

To test install:
  apt-get install python3-autopilot

Then run (in unity/tests/autopilot/)
  python3 -c "import unity.tests"
OR
  autopilot3 list unity.tests

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

Umm, it's not clear to me why you had to change stuff in DecorationsDataPool.[h|cpp] for this MP.

review: Needs Information
Revision history for this message
Christopher Townsend (townsend) wrote :

And unityshell.cpp for that matter...

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

That was me merging a branch from Marco. Opps, i swore i removed that and checked what files I was changed...strange.

3756. By Brandon Schaefer

* Merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

Well, this breaks running regular Autopilot, so until we fix *everything* to run strictly on python3, then this needs to fixed up to work for both python2.7 and python3.

review: Needs Fixing

Unmerged revisions

3756. By Brandon Schaefer

* Merge trunk

3755. By Brandon Schaefer

* Start moving to python3 for unity7 AP tests.
* Need to move compizconfig over before we can do much more

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/unity/emulators/X11.py'
2--- tests/autopilot/unity/emulators/X11.py 2014-01-13 18:35:11 +0000
3+++ tests/autopilot/unity/emulators/X11.py 2014-04-03 15:54:35 +0000
4@@ -90,7 +90,7 @@
5 """
6 try:
7 glxinfo_out = subprocess.check_output("glxinfo")
8- except OSError, e:
9+ except OSError:
10 raise OSError("Failed to run glxinfo: %s. (do you have mesa-utils installed?)" % e)
11
12 for dri in _blacklisted_drivers:
13
14=== modified file 'tests/autopilot/unity/emulators/compiz.py'
15--- tests/autopilot/unity/emulators/compiz.py 2013-04-30 22:06:54 +0000
16+++ tests/autopilot/unity/emulators/compiz.py 2014-04-03 15:54:35 +0000
17@@ -1,9 +1,8 @@
18 from __future__ import absolute_import
19+from __future__ import absolute_import
20
21 """Functions that wrap compizconfig to avoid some unpleasantness in that module."""
22
23-from __future__ import absolute_import
24-
25 from autopilot.utilities import Silence
26
27 _global_context = None
28
29=== modified file 'tests/autopilot/unity/emulators/hud.py'
30--- tests/autopilot/unity/emulators/hud.py 2013-10-03 01:33:53 +0000
31+++ tests/autopilot/unity/emulators/hud.py 2014-04-03 15:54:35 +0000
32@@ -14,7 +14,7 @@
33 from autopilot.input import Keyboard
34 from autopilot.introspection.dbus import StateNotFoundError
35 from autopilot.keybindings import KeybindingsHelper
36-from HTMLParser import HTMLParser
37+from html.parser import HTMLParser
38 import re
39
40 from unity.emulators import UnityIntrospectionObject
41
42=== modified file 'tests/autopilot/unity/tests/test_gnome_key_grabber.py'
43--- tests/autopilot/unity/tests/test_gnome_key_grabber.py 2014-02-06 09:31:09 +0000
44+++ tests/autopilot/unity/tests/test_gnome_key_grabber.py 2014-04-03 15:54:35 +0000
45@@ -7,7 +7,7 @@
46 # by the Free Software Foundation.
47
48 import dbus
49-import glib
50+from gi.repository import GLib
51 import unity
52 import logging
53
54
55=== modified file 'tests/autopilot/unity/tests/test_ibus.py'
56--- tests/autopilot/unity/tests/test_ibus.py 2014-01-29 19:21:24 +0000
57+++ tests/autopilot/unity/tests/test_ibus.py 2014-04-03 15:54:35 +0000
58@@ -85,7 +85,7 @@
59 timeout.start()
60 while self._context.get_engine() is None:
61 if self._abort is True:
62- print "Error! Could not set the engine correctly."
63+ print("Error! Could not set the engine correctly.")
64 return None
65 continue
66 timeout.cancel()
67
68=== modified file 'tests/autopilot/unity/tests/test_shopping_lens.py'
69--- tests/autopilot/unity/tests/test_shopping_lens.py 2013-05-24 15:54:49 +0000
70+++ tests/autopilot/unity/tests/test_shopping_lens.py 2014-04-03 15:54:35 +0000
71@@ -11,7 +11,7 @@
72 from autopilot.matchers import Eventually
73 from testtools.matchers import Equals, GreaterThan
74 from time import sleep
75-import urllib2
76+from urllib.request import urlopen
77 import gettext
78
79 from unity.tests import UnityTestCase
80@@ -24,7 +24,7 @@
81 super(ShoppingScopeTests, self).setUp()
82 try:
83 urllib2.urlopen("http://www.google.com", timeout=2)
84- except urllib2.URLError, e:
85+ except urllib2.URLError:
86 self.skip("Skipping test, no internet connection")
87 gettext.install("unity-scope-shopping")
88