Skip to content

Commit

Permalink
Use zip and map from six
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Oct 25, 2017
1 parent 6b86b0d commit 4e581b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions _pytest/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
4 changes: 2 additions & 2 deletions _pytest/mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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


Expand Down Expand Up @@ -427,7 +427,7 @@ def add_mark(self, mark):

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()
Expand Down
5 changes: 3 additions & 2 deletions _pytest/python_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
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

Expand Down Expand Up @@ -145,7 +146,7 @@ def __eq__(self, actual):
return ApproxBase.__eq__(self, actual)

def _yield_comparisons(self, actual):
return izip(actual, self.expected)
return zip(actual, self.expected)


class ApproxScalar(ApproxBase):
Expand Down

0 comments on commit 4e581b6

Please sign in to comment.