Use zip and map from six
This commit is contained in:
parent
6b86b0dbfe
commit
4e581b637f
|
@ -127,8 +127,6 @@ def getfuncargnames(function, is_method=False, cls=None):
|
||||||
|
|
||||||
|
|
||||||
if _PY3:
|
if _PY3:
|
||||||
imap = map
|
|
||||||
izip = zip
|
|
||||||
STRING_TYPES = bytes, str
|
STRING_TYPES = bytes, str
|
||||||
UNICODE_TYPES = str,
|
UNICODE_TYPES = str,
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import inspect
|
||||||
import warnings
|
import warnings
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
from .compat import imap
|
from six.moves import map
|
||||||
from .deprecated import MARK_PARAMETERSET_UNPACKING
|
from .deprecated import MARK_PARAMETERSET_UNPACKING
|
||||||
|
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ class MarkInfo(object):
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
""" yield MarkInfo objects each relating to a marking-call. """
|
""" yield MarkInfo objects each relating to a marking-call. """
|
||||||
return imap(MarkInfo, self._marks)
|
return map(MarkInfo, self._marks)
|
||||||
|
|
||||||
|
|
||||||
MARK_GEN = MarkGenerator()
|
MARK_GEN = MarkGenerator()
|
||||||
|
|
|
@ -2,8 +2,9 @@ import math
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import py
|
import py
|
||||||
|
from six.moves import zip
|
||||||
|
|
||||||
from _pytest.compat import isclass, izip
|
from _pytest.compat import isclass
|
||||||
from _pytest.outcomes import fail
|
from _pytest.outcomes import fail
|
||||||
import _pytest._code
|
import _pytest._code
|
||||||
|
|
||||||
|
@ -145,7 +146,7 @@ class ApproxSequence(ApproxBase):
|
||||||
return ApproxBase.__eq__(self, actual)
|
return ApproxBase.__eq__(self, actual)
|
||||||
|
|
||||||
def _yield_comparisons(self, actual):
|
def _yield_comparisons(self, actual):
|
||||||
return izip(actual, self.expected)
|
return zip(actual, self.expected)
|
||||||
|
|
||||||
|
|
||||||
class ApproxScalar(ApproxBase):
|
class ApproxScalar(ApproxBase):
|
||||||
|
|
Loading…
Reference in New Issue