diff --git a/_pytest/compat.py b/_pytest/compat.py index 1d8c2f331..d5f7ffe56 100644 --- a/_pytest/compat.py +++ b/_pytest/compat.py @@ -111,7 +111,7 @@ if sys.version_info[:2] == (2, 6): if _PY3: import codecs - + imap = map STRING_TYPES = bytes, str def _escape_strings(val): @@ -145,6 +145,8 @@ if _PY3: else: STRING_TYPES = bytes, str, unicode + from itertools import imap + def _escape_strings(val): """In py2 bytes and str are the same type, so return if it's a bytes object, return it unchanged if it is a full ascii string, @@ -213,4 +215,4 @@ def _is_unittest_unexpected_success_a_failure(): Changed in version 3.4: Returns False if there were any unexpectedSuccesses from tests marked with the expectedFailure() decorator. """ - return sys.version_info >= (3, 4) \ No newline at end of file + return sys.version_info >= (3, 4) diff --git a/_pytest/mark.py b/_pytest/mark.py index d18654fb6..3c97dc153 100644 --- a/_pytest/mark.py +++ b/_pytest/mark.py @@ -2,7 +2,7 @@ import inspect from collections import namedtuple from operator import attrgetter -from itertools import imap +from .compat import imap def alias(name): return property(attrgetter(name), doc='alias for ' + name)