@@ -1,7 +1,7 @@
11# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
22#
33# Unity Autopilot Test Suite
4−# Copyright (C) 2012, 2013, 2014 Canonical
4+# Copyright (C) 2012, 2013, 2014, 2015 Canonical
55#
66# This program is free software: you can redistribute it and/or modify
77# it under the terms of the GNU General Public License as published by
@@ -19,8 +19,6 @@
1919
2020"""Tests for Notifications"""
2121
22−from __future__ import absolute_import
23−
2422from unity8 import shell
2523from unity8.process_helpers import unlock_unity
2624from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
@@ -34,15 +32,9 @@ import os
3432import logging
3533import signal
3634import subprocess
37−import sys
3835
3936logger = logging.getLogger(__name__)
4037
41−# from __future__ import range
42−# (python3's range, is same as python2's xrange)
43−if sys.version_info < (3,):
44− range = xrange
45−
4638
4739class NotificationsBase(UnityTestCase):
4840 """Base class for all notification tests that provides helper methods."""
@@ -118,7 +110,7 @@ class InteractiveNotificationBase(NotificationsBase):
118110 """Collection of test for Interactive tests including snap decisions."""
119111
120112 def setUp(self):
121− super(InteractiveNotificationBase, self).setUp()
113+ super().setUp()
122114 # Need to keep track when we launch the notification script.
123115 self._notify_proc = None
124116
@@ -338,7 +330,7 @@ class InteractiveNotificationBase(NotificationsBase):
338330 action_string = "%s,%s" % (action_id, action_label)
339331 script_args.extend(['--action', action_string])
340332
341− python_bin = subprocess.check_output(['which', 'python']).strip()
333+ python_bin = subprocess.check_output(['which', 'python3']).strip()
342334 command = [python_bin, self._get_notify_script()] + script_args
343335 logger.info("Launching snap-decision notification as: %s", command)
344336 self._notify_proc = subprocess.Popen(
@@ -410,7 +402,7 @@ class EphemeralNotificationsTests(NotificationsBase):
410402 """Collection of tests for Emphemeral notifications (non-interactive.)"""
411403
412404 def setUp(self):
413− super(EphemeralNotificationsTests, self).setUp()
405+ super().setUp()
414406 # Because we are using the Notify library we need to init and un-init
415407 # otherwise we get crashes.
416408 Notify.init("Autopilot Ephemeral Notification Tests")