summaryrefslogtreecommitdiff
path: root/_pytest/compat.py
diff options
context:
space:
mode:
authorKale Kundert <kale@thekunderts.net>2017-06-15 09:03:31 -0700
committerKale Kundert <kale@thekunderts.net>2017-06-15 09:19:10 -0700
commit8badb47db60d43966a56cfe5f0630e38358c309a (patch)
tree18f5eb051c6da62dc075e097a71574d14457d8e7 /_pytest/compat.py
parent89292f08dc73ef9d20a3488098b07d794a4b3248 (diff)
downloadpytest-8badb47db60d43966a56cfe5f0630e38358c309a.tar.gz
Implement suggestions from code review.
- Avoid importing numpy unless necessary. - Mention numpy arrays and dictionaries in the docs. - Add numpy to the list of tox dependencies. - Don't unnecessarily copy arrays or allocate empty space for them. - Use code from compat.py rather than writing py2/3 versions of things myself. - Avoid reimplementing __repr__ for built-in types. - Add an option to consider NaN == NaN, because sometimes people use NaN to mean "missing data".
Diffstat (limited to '_pytest/compat.py')
-rw-r--r--_pytest/compat.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/_pytest/compat.py b/_pytest/compat.py
index 8c200af5f..0554efeb7 100644
--- a/_pytest/compat.py
+++ b/_pytest/compat.py
@@ -125,6 +125,7 @@ if sys.version_info[:2] == (2, 6):
if _PY3:
import codecs
imap = map
+ izip = zip
STRING_TYPES = bytes, str
UNICODE_TYPES = str,
@@ -160,7 +161,7 @@ else:
STRING_TYPES = bytes, str, unicode
UNICODE_TYPES = unicode,
- from itertools import imap # NOQA
+ from itertools import imap, izip # NOQA
def _escape_strings(val):
"""In py2 bytes and str are the same type, so return if it's a bytes