Skip to content

Commit a35f92c

Browse files
committed
removed skipif, using SkipTest Exception
Removed skipif decorator (it may be buggy or I might not understand it). Used a SkipTest Exception. Seems to work in local testing of Python 3.4.
1 parent 8a3a8cb commit a35f92c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

lib/mpl_toolkits/basemap/test.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
# beginnings of a test suite.
77

8-
from numpy.testing import TestCase, assert_almost_equal, dec
8+
from numpy.testing import TestCase, assert_almost_equal
9+
from unittest import SkipTest
910

1011
# For Python 3.x this will be true
1112
PY3 = (sys.version_info[0] == 3)
@@ -153,8 +154,7 @@ def test_less_than_n_by_3_points_should_work(self):
153154
lonsout = bm.shiftdata(lonsin[:, :2])
154155
assert_almost_equal(lonsout_expected, lonsout)
155156

156-
@dec.skipif( PY3 and pyproj.__version__ <= "1.9.4",
157-
"TestProjectCoords tests skipped in Python 3.x with pyproj version 1.9.4 and below." )
157+
158158
class TestProjectCoords(TestCase):
159159
def get_data(self):
160160
lons, lats = np.arange(-180, 180, 20), np.arange(-90, 90, 10)
@@ -167,6 +167,10 @@ def test_convert(self):
167167
"""
168168
Should not fail on C non-contiguous arrays
169169
"""
170+
# skip test for Python 3.x and pyproj 1.9.4 or less
171+
if PY3 and pyproj.__version__ <= "1.9.4":
172+
raise SkipTest("Test skipped in Python 3.x with pyproj version 1.9.4 and below.")
173+
170174
lons, lats, bmp = self.get_data()
171175
assert not lons.flags['C_CONTIGUOUS']
172176
assert isinstance(lons, np.ndarray)
@@ -176,7 +180,10 @@ def test_convert(self):
176180

177181

178182
def test_results_should_be_same_for_c_and_f_order_arrays(self):
179-
183+
# skip test for Python 3.x and pyproj 1.9.4 or less
184+
if PY3 and pyproj.__version__ <= "1.9.4":
185+
raise SkipTest("Test skipped in Python 3.x with pyproj version 1.9.4 and below.")
186+
180187
lons, lats, bmp = self.get_data()
181188

182189
xx1, yy1 = bmp(lons.copy(order="C"), lats.copy(order="C"))

0 commit comments

Comments
 (0)