aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc Bonnici <marc.bonnici@arm.com>2018-07-03 16:56:57 +0100
committersetrofim <setrofim@gmail.com>2018-07-04 11:54:17 +0100
commit57ddf7845ce138a8819e3e40e8c9c4b9eec53f1c (patch)
treedbf035fe9df5be5eded49a61d291a3f010b7d2dc /tests
parent107fdc203cec148840b65207f09789b28f0d30d7 (diff)
tests: Update tests to work with python3
Diffstat (limited to 'tests')
-rw-r--r--tests/test_agenda_parser.py4
-rw-r--r--tests/test_utils.py12
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_agenda_parser.py b/tests/test_agenda_parser.py
index 4829b957..e4fb40c3 100644
--- a/tests/test_agenda_parser.py
+++ b/tests/test_agenda_parser.py
@@ -127,7 +127,7 @@ class AgendaTest(TestCase):
def test_duplicate_id(self):
try:
self.parser.load(self.config, duplicate_agenda, 'test')
- except ConfigError, e:
+ except ConfigError as e:
assert_in('duplicate', e.message.lower()) # pylint: disable=E1101
else:
raise Exception('ConfigError was not raised for an agenda with duplicate ids.')
@@ -135,7 +135,7 @@ class AgendaTest(TestCase):
def test_yaml_missing_field(self):
try:
self.parser.load(self.config, invalid_agenda, 'test')
- except ConfigError, e:
+ except ConfigError as e:
assert_in('workload name', e.message)
else:
raise Exception('ConfigError was not raised for an invalid agenda.')
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 87a382a4..6708a0fe 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -38,7 +38,7 @@ class TestPriorityList(TestCase):
for key in elements:
pl.add(elements[key], priority=key)
- match = zip(sorted(elements.values()), pl[:])
+ match = list(zip(sorted(elements.values()), pl[:]))
for pair in match:
assert(pair[0] == pair[1])
@@ -54,7 +54,7 @@ class TestPriorityList(TestCase):
pl.add(elements[key], priority=key)
del elements[2]
del pl[2]
- match = zip(sorted(elements.values()), pl[:])
+ match = list(zip(sorted(elements.values()), pl[:]))
for pair in match:
assert(pair[0] == pair[1])
@@ -65,10 +65,10 @@ class TestPriorityList(TestCase):
pl.add('3', 3)
pl.add('2.2', 2)
it = iter(pl)
- assert_equal(it.next(), '3')
- assert_equal(it.next(), '2.1')
- assert_equal(it.next(), '2.2')
- assert_equal(it.next(), '1')
+ assert_equal(next(it), '3')
+ assert_equal(next(it), '2.1')
+ assert_equal(next(it), '2.2')
+ assert_equal(next(it), '1')
def test_iterator_break(self):
pl = prioritylist()