diff options
author | Stephan Hoyer <shoyer@google.com> | 2018-10-27 13:29:26 -0700 |
---|---|---|
committer | Stephan Hoyer <shoyer@google.com> | 2018-10-27 13:29:26 -0700 |
commit | c4f853968c862849f159bad5c187310c1aa93e56 (patch) | |
tree | 1268890938e47fd2c1a845da3ecfbf5e702fcb28 /numpy | |
parent | ced6475d519552455cc50831052213c1249a909c (diff) | |
download | numpy-c4f853968c862849f159bad5c187310c1aa93e56.tar.gz |
MAINT: fix test on Python 2
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_shape_base.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/core/tests/test_shape_base.py b/numpy/core/tests/test_shape_base.py index 0aebe54d0..b2c610da6 100644 --- a/numpy/core/tests/test_shape_base.py +++ b/numpy/core/tests/test_shape_base.py @@ -1,6 +1,7 @@ from __future__ import division, absolute_import, print_function import warnings +import sys import numpy as np from numpy.core import ( array, arange, atleast_1d, atleast_2d, atleast_3d, block, vstack, hstack, @@ -158,8 +159,10 @@ class TestHstack(object): def test_generator(self): with assert_warns(FutureWarning): hstack((np.arange(3) for _ in range(2))) - with assert_warns(FutureWarning): - hstack(map(lambda x: x, np.ones((3, 2)))) + if sys.version_info.major > 2: + # map returns a list on Python 2 + with assert_warns(FutureWarning): + hstack(map(lambda x: x, np.ones((3, 2)))) class TestVstack(object): |