5
5
6
6
# beginnings of a test suite.
7
7
8
- from numpy .testing import TestCase , assert_almost_equal , dec
8
+ from numpy .testing import TestCase , assert_almost_equal
9
+ from unittest import SkipTest
9
10
10
11
# For Python 3.x this will be true
11
12
PY3 = (sys .version_info [0 ] == 3 )
@@ -153,8 +154,7 @@ def test_less_than_n_by_3_points_should_work(self):
153
154
lonsout = bm .shiftdata (lonsin [:, :2 ])
154
155
assert_almost_equal (lonsout_expected , lonsout )
155
156
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
+
158
158
class TestProjectCoords (TestCase ):
159
159
def get_data (self ):
160
160
lons , lats = np .arange (- 180 , 180 , 20 ), np .arange (- 90 , 90 , 10 )
@@ -167,6 +167,10 @@ def test_convert(self):
167
167
"""
168
168
Should not fail on C non-contiguous arrays
169
169
"""
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
+
170
174
lons , lats , bmp = self .get_data ()
171
175
assert not lons .flags ['C_CONTIGUOUS' ]
172
176
assert isinstance (lons , np .ndarray )
@@ -176,7 +180,10 @@ def test_convert(self):
176
180
177
181
178
182
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
+
180
187
lons , lats , bmp = self .get_data ()
181
188
182
189
xx1 , yy1 = bmp (lons .copy (order = "C" ), lats .copy (order = "C" ))
0 commit comments