From 4e581b637f3082836a0c711b9fb62dac485cca79 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 24 Oct 2017 22:13:32 -0200 Subject: [PATCH] Use zip and map from six --- _pytest/compat.py | 2 -- _pytest/mark.py | 4 ++-- _pytest/python_api.py | 5 +++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/_pytest/compat.py b/_pytest/compat.py index 263305861..7560fbec3 100644 --- a/_pytest/compat.py +++ b/_pytest/compat.py @@ -127,8 +127,6 @@ def getfuncargnames(function, is_method=False, cls=None): if _PY3: - imap = map - izip = zip STRING_TYPES = bytes, str UNICODE_TYPES = str, diff --git a/_pytest/mark.py b/_pytest/mark.py index f4058989a..03b058d95 100644 --- a/_pytest/mark.py +++ b/_pytest/mark.py @@ -5,7 +5,7 @@ import inspect import warnings from collections import namedtuple from operator import attrgetter -from .compat import imap +from six.moves import map from .deprecated import MARK_PARAMETERSET_UNPACKING @@ -427,7 +427,7 @@ class MarkInfo(object): def __iter__(self): """ yield MarkInfo objects each relating to a marking-call. """ - return imap(MarkInfo, self._marks) + return map(MarkInfo, self._marks) MARK_GEN = MarkGenerator() diff --git a/_pytest/python_api.py b/_pytest/python_api.py index 6ae3e81b6..bf1cd147e 100644 --- a/_pytest/python_api.py +++ b/_pytest/python_api.py @@ -2,8 +2,9 @@ import math import sys import py +from six.moves import zip -from _pytest.compat import isclass, izip +from _pytest.compat import isclass from _pytest.outcomes import fail import _pytest._code @@ -145,7 +146,7 @@ class ApproxSequence(ApproxBase): return ApproxBase.__eq__(self, actual) def _yield_comparisons(self, actual): - return izip(actual, self.expected) + return zip(actual, self.expected) class ApproxScalar(ApproxBase):