diff --git a/taskcluster/taskgraph/test/test_util_parameterization.py b/taskcluster/taskgraph/test/test_util_parameterization.py index d98f14e3de4a0..307df122d28c2 100644 --- a/taskcluster/taskgraph/test/test_util_parameterization.py +++ b/taskcluster/taskgraph/test/test_util_parameterization.py @@ -4,13 +4,11 @@ from __future__ import absolute_import, print_function, unicode_literals -import sys import unittest import datetime import mock import os -import pytest from mozunit import main from taskgraph.util.parameterization import ( resolve_timestamps, @@ -29,9 +27,6 @@ def test_no_change(self): } self.assertEqual(resolve_timestamps(now, input), input) - @pytest.mark.xfail( - sys.version_info >= (3, 0), reason="python3 migration is not complete" - ) def test_buried_replacement(self): now = datetime.datetime(2018, 1, 1) input = {"key": [{"key2": [{'relative-datestamp': '1 day'}]}]} @@ -61,41 +56,26 @@ def test_no_change(self): self.do({'in-a-list': ['stuff', {'property': ''}]}, {'in-a-list': ['stuff', {'property': ''}]}) - @pytest.mark.xfail( - sys.version_info >= (3, 0), reason="python3 migration is not complete" - ) def test_in_list(self): "resolve_task_references resolves task references in a list" self.do({'in-a-list': ['stuff', {'task-reference': ''}]}, {'in-a-list': ['stuff', 'tid1']}) - @pytest.mark.xfail( - sys.version_info >= (3, 0), reason="python3 migration is not complete" - ) def test_in_dict(self): "resolve_task_references resolves task references in a dict" self.do({'in-a-dict': {'stuff': {'task-reference': ''}}}, {'in-a-dict': {'stuff': 'tid2'}}) - @pytest.mark.xfail( - sys.version_info >= (3, 0), reason="python3 migration is not complete" - ) def test_multiple(self): "resolve_task_references resolves multiple references in the same string" self.do({'multiple': {'task-reference': 'stuff stuff after'}}, {'multiple': 'stuff tid1 stuff tid2 after'}) - @pytest.mark.xfail( - sys.version_info >= (3, 0), reason="python3 migration is not complete" - ) def test_embedded(self): "resolve_task_references resolves ebmedded references" self.do({'embedded': {'task-reference': 'stuff before stuff after'}}, {'embedded': 'stuff before tid3 stuff after'}) - @pytest.mark.xfail( - sys.version_info >= (3, 0), reason="python3 migration is not complete" - ) def test_escaping(self): "resolve_task_references resolves escapes in task references" self.do({'escape': {'task-reference': '<<>>'}}, @@ -106,25 +86,16 @@ def test_multikey(self): self.do({'escape': {'task-reference': '', 'another-key': True}}, {'escape': {'task-reference': '', 'another-key': True}}) - @pytest.mark.xfail( - sys.version_info >= (3, 0), reason="python3 migration is not complete" - ) def test_self(self): "resolve_task_references resolves `self` to the provided task id" self.do({'escape': {'task-reference': ''}}, {'escape': 'tid-self'}) - @pytest.mark.xfail( - sys.version_info >= (3, 0), reason="python3 migration is not complete" - ) def test_decision(self): "resolve_task_references resolves `decision` to the provided decision task id" self.do({'escape': {'task-reference': ''}}, {'escape': 'tid-decision'}) - @pytest.mark.xfail( - sys.version_info >= (3, 0), reason="python3 migration is not complete" - ) def test_invalid(self): "resolve_task_references raises a KeyError on reference to an invalid task" self.assertRaisesRegexp( @@ -136,9 +107,6 @@ def test_invalid(self): ) -@pytest.mark.xfail( - sys.version_info >= (3, 0), reason="python3 migration is not complete" -) class TestArtifactRefs(unittest.TestCase): def do(self, input, output): diff --git a/taskcluster/taskgraph/util/parameterization.py b/taskcluster/taskgraph/util/parameterization.py index 3a7a7252c8a3e..78771c528f2f0 100644 --- a/taskcluster/taskgraph/util/parameterization.py +++ b/taskcluster/taskgraph/util/parameterization.py @@ -22,7 +22,7 @@ def recurse(val): elif isinstance(val, dict): if len(val) == 1: for param_key, param_fn in param_fns.items(): - if val.keys() == [param_key]: + if set(six.iterkeys(val)) == {param_key}: return param_fn(val[param_key]) return {k: recurse(v) for k, v in six.iteritems(val)} else: