Skip to content

Commit 8badb47

Browse files
committed
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".
1 parent 89292f0 commit 8badb47

File tree

4 files changed

+175
-153
lines changed

4 files changed

+175
-153
lines changed

_pytest/compat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def isclass(object):
125125
if _PY3:
126126
import codecs
127127
imap = map
128+
izip = zip
128129
STRING_TYPES = bytes, str
129130
UNICODE_TYPES = str,
130131

@@ -160,7 +161,7 @@ def _escape_strings(val):
160161
STRING_TYPES = bytes, str, unicode
161162
UNICODE_TYPES = unicode,
162163

163-
from itertools import imap # NOQA
164+
from itertools import imap, izip # NOQA
164165

165166
def _escape_strings(val):
166167
"""In py2 bytes and str are the same type, so return if it's a bytes

0 commit comments

Comments
 (0)