Skip to content

Commit 8141c91

Browse files
committed
Converted windows / 32bit skips into decorators
1 parent 288bf6e commit 8141c91

File tree

14 files changed

+67
-96
lines changed

14 files changed

+67
-96
lines changed

pandas/tests/computation/test_eval.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import pandas.core.computation.expr as expr
3030
import pandas.util.testing as tm
31+
import pandas.util._test_decorators as td
3132
from pandas.util.testing import (assert_frame_equal, randbool,
3233
assert_numpy_array_equal, assert_series_equal,
3334
assert_produces_warning)
@@ -175,9 +176,8 @@ def test_floor_division(self):
175176
for lhs, rhs in product(self.lhses, self.rhses):
176177
self.check_floor_division(lhs, '//', rhs)
177178

179+
@td.skip_if_windows
178180
def test_pow(self):
179-
tm._skip_if_windows()
180-
181181
# odd failure on win32 platform, so skip
182182
for lhs, rhs in product(self.lhses, self.rhses):
183183
self.check_pow(lhs, '**', rhs)

pandas/tests/indexes/datetimes/test_date_range.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import pandas as pd
1313
import pandas.util.testing as tm
14+
import pandas.util._test_decorators as td
1415
from pandas import compat
1516
from pandas import date_range, bdate_range, offsets, DatetimeIndex, Timestamp
1617
from pandas.tseries.offsets import (generate_range, CDay, BDay, DateOffset,
@@ -49,8 +50,8 @@ def test_date_range_timestamp_equiv_explicit_pytz(self):
4950
ts = Timestamp('20090415', tz=pytz.timezone('US/Eastern'), freq='D')
5051
assert ts == stamp
5152

53+
@td.skip_if_windows_python_3
5254
def test_date_range_timestamp_equiv_explicit_dateutil(self):
53-
tm._skip_if_windows_python_3()
5455
from pandas._libs.tslibs.timezones import dateutil_gettz as gettz
5556

5657
rng = date_range('20090415', '20090519', tz=gettz('US/Eastern'))

pandas/tests/indexes/datetimes/test_setops.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import pandas as pd
77
import pandas.util.testing as tm
8+
import pandas.util._test_decorators as td
89
from pandas import (DatetimeIndex, date_range, Series, bdate_range, DataFrame,
910
Int64Index, Index, to_datetime)
1011
from pandas.tseries.offsets import Minute, BMonthEnd, MonthEnd
@@ -358,9 +359,8 @@ def test_month_range_union_tz_pytz(self):
358359

359360
early_dr.union(late_dr)
360361

362+
@td.skip_if_windows_python_3
361363
def test_month_range_union_tz_dateutil(self):
362-
tm._skip_if_windows_python_3()
363-
364364
from pandas._libs.tslibs.timezones import dateutil_gettz
365365
tz = dateutil_gettz('US/Eastern')
366366

pandas/tests/indexes/period/test_period.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import numpy as np
44

55
import pandas as pd
6+
import pandas.util._test_decorators as td
67
from pandas.util import testing as tm
78
from pandas import (PeriodIndex, period_range, notna, DatetimeIndex, NaT,
89
Index, Period, Int64Index, Series, DataFrame, date_range,
@@ -544,9 +545,8 @@ def test_shift_nat(self):
544545
tm.assert_index_equal(result, expected)
545546
assert result.name == expected.name
546547

548+
@td.skip_if_32bit
547549
def test_ndarray_compat_properties(self):
548-
if compat.is_platform_32bit():
549-
pytest.skip("skipping on 32bit")
550550
super(TestPeriodIndex, self).test_ndarray_compat_properties()
551551

552552
def test_shift_ndarray(self):

pandas/tests/indexing/test_coercion.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import pandas as pd
77
import pandas.util.testing as tm
8+
import pandas.util._test_decorators as td
89
import pandas.compat as compat
910

1011

@@ -1220,6 +1221,8 @@ def setup_method(self, method):
12201221
self.rep['timedelta64[ns]'] = [pd.Timedelta('1 day'),
12211222
pd.Timedelta('2 day')]
12221223

1224+
@td.skip_if_windows
1225+
@td.skip_if_32bit
12231226
def _assert_replace_conversion(self, from_key, to_key, how):
12241227
index = pd.Index([3, 4], name='xxx')
12251228
obj = pd.Series(self.rep[from_key], index=index, name='yyy')
@@ -1242,11 +1245,6 @@ def _assert_replace_conversion(self, from_key, to_key, how):
12421245
(from_key == 'complex128' and
12431246
to_key in ('int64', 'float64'))):
12441247

1245-
# buggy on 32-bit / window
1246-
if compat.is_platform_32bit() or compat.is_platform_windows():
1247-
pytest.skip("32-bit platform buggy: {0} -> {1}".format
1248-
(from_key, to_key))
1249-
12501248
# Expected: do not downcast by replacement
12511249
exp = pd.Series(self.rep[to_key], index=index,
12521250
name='yyy', dtype=from_key)

pandas/tests/io/parser/c_parser_only.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import pandas as pd
1818
import pandas.util.testing as tm
19+
import pandas.util._test_decorators as td
1920
from pandas import DataFrame
2021
from pandas import compat
2122
from pandas.compat import StringIO, range, lrange
@@ -129,9 +130,8 @@ def test_unsupported_dtype(self):
129130
dtype={'A': 'U8'},
130131
index_col=0)
131132

133+
@td.skip_if_32bit
132134
def test_precise_conversion(self):
133-
# see gh-8002
134-
tm._skip_if_32bit()
135135
from decimal import Decimal
136136

137137
normal_errors = []

pandas/tests/io/test_pytables.py

+25-35
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
isna, compat, concat, Timestamp)
1818

1919
import pandas.util.testing as tm
20+
import pandas.util._test_decorators as td
2021
from pandas.util.testing import (assert_panel4d_equal,
2122
assert_panel_equal,
2223
assert_frame_equal,
@@ -40,10 +41,6 @@
4041
LooseVersion('2.2') else 'zlib')
4142

4243

43-
# testing on windows/py3 seems to fault
44-
# for using compression
45-
skip_compression = PY3 and is_platform_windows()
46-
4744
# contextmanager to ensure the file cleanup
4845

4946

@@ -719,12 +716,10 @@ def test_put_compression(self):
719716
pytest.raises(ValueError, store.put, 'b', df,
720717
format='fixed', complib='zlib')
721718

719+
@td.skip_if_windows_python_3
722720
def test_put_compression_blosc(self):
723721
tm.skip_if_no_package('tables', min_version='2.2',
724722
app='blosc support')
725-
if skip_compression:
726-
pytest.skip("skipping on windows/PY3")
727-
728723
df = tm.makeTimeDataFrame()
729724

730725
with ensure_clean_store(self.path) as store:
@@ -2892,29 +2887,26 @@ def test_timeseries_preepoch(self):
28922887
except OverflowError:
28932888
pytest.skip('known failer on some windows platforms')
28942889

2895-
def test_frame(self):
2890+
@pytest.mark.parametrize("compression", [
2891+
(False,),
2892+
td.skip_if_windows_python_3()(True,)
2893+
])
2894+
def test_frame(self, compression):
28962895

28972896
df = tm.makeDataFrame()
28982897

28992898
# put in some random NAs
29002899
df.values[0, 0] = np.nan
29012900
df.values[5, 3] = np.nan
29022901

2903-
self._check_roundtrip_table(df, tm.assert_frame_equal)
2904-
self._check_roundtrip(df, tm.assert_frame_equal)
2905-
2906-
if not skip_compression:
2907-
self._check_roundtrip_table(df, tm.assert_frame_equal,
2908-
compression=True)
2909-
self._check_roundtrip(df, tm.assert_frame_equal,
2910-
compression=True)
2902+
self._check_roundtrip_table(df, tm.assert_frame_equal,
2903+
compression=compression)
2904+
self._check_roundtrip(df, tm.assert_frame_equal,
2905+
compression=compression)
29112906

29122907
tdf = tm.makeTimeDataFrame()
2913-
self._check_roundtrip(tdf, tm.assert_frame_equal)
2914-
2915-
if not skip_compression:
2916-
self._check_roundtrip(tdf, tm.assert_frame_equal,
2917-
compression=True)
2908+
self._check_roundtrip(tdf, tm.assert_frame_equal,
2909+
compression=compression)
29182910

29192911
with ensure_clean_store(self.path) as store:
29202912
# not consolidated
@@ -3021,7 +3013,11 @@ def test_store_series_name(self):
30213013
recons = store['series']
30223014
tm.assert_series_equal(recons, series)
30233015

3024-
def test_store_mixed(self):
3016+
@pytest.mark.parametrize("compression", [
3017+
(False,),
3018+
td.skip_if_windows_python_3()(True,)
3019+
])
3020+
def test_store_mixed(self, compression):
30253021

30263022
def _make_one():
30273023
df = tm.makeDataFrame()
@@ -3046,19 +3042,12 @@ def _make_one():
30463042
tm.assert_frame_equal(store['obj'], df2)
30473043

30483044
# check that can store Series of all of these types
3049-
self._check_roundtrip(df1['obj1'], tm.assert_series_equal)
3050-
self._check_roundtrip(df1['bool1'], tm.assert_series_equal)
3051-
self._check_roundtrip(df1['int1'], tm.assert_series_equal)
3052-
3053-
if not skip_compression:
3054-
self._check_roundtrip(df1['obj1'], tm.assert_series_equal,
3055-
compression=True)
3056-
self._check_roundtrip(df1['bool1'], tm.assert_series_equal,
3057-
compression=True)
3058-
self._check_roundtrip(df1['int1'], tm.assert_series_equal,
3059-
compression=True)
3060-
self._check_roundtrip(df1, tm.assert_frame_equal,
3061-
compression=True)
3045+
self._check_roundtrip(df1['obj1'], tm.assert_series_equal,
3046+
compression=compression)
3047+
self._check_roundtrip(df1['bool1'], tm.assert_series_equal,
3048+
compression=compression)
3049+
self._check_roundtrip(df1['int1'], tm.assert_series_equal,
3050+
compression=compression)
30623051

30633052
def test_wide(self):
30643053

@@ -5620,6 +5609,7 @@ def test_fixed_offset_tz(self):
56205609
tm.assert_index_equal(recons.index, rng)
56215610
assert rng.tz == recons.index.tz
56225611

5612+
@td.skip_if_windows
56235613
def test_store_timezone(self):
56245614
# GH2852
56255615
# issue storing datetime.date with a timezone as it resets when read

pandas/tests/scalar/test_timestamp.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError
1616

1717
import pandas.util.testing as tm
18+
import pandas.util._test_decorators as td
1819
from pandas.tseries import offsets, frequencies
1920
from pandas._libs.tslibs.timezones import get_timezone, dateutil_gettz as gettz
2021
from pandas._libs.tslibs import conversion, period
@@ -943,6 +944,7 @@ def test_is_leap_year(self, tz):
943944
dt = Timestamp('2100-01-01 00:00:00', tz=tz)
944945
assert not dt.is_leap_year
945946

947+
@td.skip_if_windows
946948
def test_timestamp(self):
947949
# GH#17329
948950
# tz-naive --> treat it as if it were UTC for purposes of timestamp()
@@ -1366,9 +1368,8 @@ def test_timestamp_to_datetime_explicit_pytz(self):
13661368
assert stamp == dtval
13671369
assert stamp.tzinfo == dtval.tzinfo
13681370

1371+
@td.skip_if_windows_python_3
13691372
def test_timestamp_to_datetime_explicit_dateutil(self):
1370-
tm._skip_if_windows_python_3()
1371-
13721373
stamp = Timestamp('20090415', tz=gettz('US/Eastern'), freq='D')
13731374
dtval = stamp.to_pydatetime()
13741375
assert stamp == dtval

pandas/tests/sparse/test_libsparse.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import numpy as np
55
import operator
66
import pandas.util.testing as tm
7+
import pandas.util._test_decorators as td
78

89
from pandas import compat
910

@@ -190,6 +191,7 @@ def test_intindex_make_union(self):
190191

191192
class TestSparseIndexIntersect(object):
192193

194+
@td.skip_if_windows
193195
def test_intersect(self):
194196
def _check_correct(a, b, expected):
195197
result = a.intersect(b)
@@ -212,8 +214,6 @@ def _check_case(xloc, xlen, yloc, ylen, eloc, elen):
212214
_check_length_exc(xindex.to_int_index(),
213215
longer_index.to_int_index())
214216

215-
if compat.is_platform_windows():
216-
pytest.skip("segfaults on win-64 when all tests are run")
217217
check_cases(_check_case)
218218

219219
def test_intersect_empty(self):

pandas/tests/tseries/test_timezones.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from datetime import datetime, timedelta, tzinfo, date
1313

1414
import pandas.util.testing as tm
15+
import pandas.util._test_decorators as td
1516
import pandas.tseries.offsets as offsets
1617
from pandas.compat import lrange, zip, PY3
1718
from pandas.core.indexes.datetimes import bdate_range, date_range
@@ -958,10 +959,8 @@ def cmptz(self, tz1, tz2):
958959
def localize(self, tz, x):
959960
return x.replace(tzinfo=tz)
960961

962+
@td.skip_if_windows
961963
def test_utc_with_system_utc(self):
962-
# Skipped on win32 due to dateutil bug
963-
tm._skip_if_windows()
964-
965964
from pandas._libs.tslibs.timezones import maybe_get_tz
966965

967966
# from system utc to real utc
@@ -1270,6 +1269,7 @@ def test_ambiguous_compat(self):
12701269
assert (result_pytz.to_pydatetime().tzname() ==
12711270
result_dateutil.to_pydatetime().tzname())
12721271

1272+
@td.skip_if_windows
12731273
def test_replace_tzinfo(self):
12741274
# GH 15683
12751275
dt = datetime(2016, 3, 27, 1)
@@ -1663,6 +1663,7 @@ def test_normalize_tz(self):
16631663
assert result.is_normalized
16641664
assert not rng.is_normalized
16651665

1666+
@td.skip_if_windows
16661667
def test_normalize_tz_local(self):
16671668
# see gh-13459
16681669
timezones = ['US/Pacific', 'US/Eastern', 'UTC', 'Asia/Kolkata',

pandas/tests/util/test_testing.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sys
66
from pandas import Series, DataFrame
77
import pandas.util.testing as tm
8+
import pandas.util._test_decorators as td
89
from pandas.util.testing import (assert_almost_equal, raise_with_traceback,
910
assert_index_equal, assert_series_equal,
1011
assert_frame_equal, assert_numpy_array_equal,
@@ -159,12 +160,9 @@ def test_raise_with_traceback(self):
159160

160161
class TestAssertNumpyArrayEqual(object):
161162

163+
@td.skip_if_windows
162164
def test_numpy_array_equal_message(self):
163165

164-
if is_platform_windows():
165-
pytest.skip("windows has incomparable line-endings "
166-
"and uses L on the shape")
167-
168166
expected = """numpy array are different
169167
170168
numpy array shapes are different
@@ -287,12 +285,9 @@ def test_numpy_array_equal_message(self):
287285
assert_almost_equal(np.array([1, 2]), np.array([3, 4, 5]),
288286
obj='Index')
289287

288+
@td.skip_if_windows
290289
def test_numpy_array_equal_object_message(self):
291290

292-
if is_platform_windows():
293-
pytest.skip("windows has incomparable line-endings "
294-
"and uses L on the shape")
295-
296291
a = np.array([pd.Timestamp('2011-01-01'), pd.Timestamp('2011-01-01')])
297292
b = np.array([pd.Timestamp('2011-01-01'), pd.Timestamp('2011-01-02')])
298293

0 commit comments

Comments
 (0)