Skip to content

Converted windows / 32bit skips into decorators #18693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/tests/computation/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import pandas.core.computation.expr as expr
import pandas.util.testing as tm
import pandas.util._test_decorators as td
from pandas.util.testing import (assert_frame_equal, randbool,
assert_numpy_array_equal, assert_series_equal,
assert_produces_warning)
Expand Down Expand Up @@ -175,9 +176,8 @@ def test_floor_division(self):
for lhs, rhs in product(self.lhses, self.rhses):
self.check_floor_division(lhs, '//', rhs)

@td.skip_if_windows
def test_pow(self):
tm._skip_if_windows()

# odd failure on win32 platform, so skip
for lhs, rhs in product(self.lhses, self.rhses):
self.check_pow(lhs, '**', rhs)
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/indexes/datetimes/test_date_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

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

@td.skip_if_windows_python_3
def test_date_range_timestamp_equiv_explicit_dateutil(self):
tm._skip_if_windows_python_3()
from pandas._libs.tslibs.timezones import dateutil_gettz as gettz

rng = date_range('20090415', '20090519', tz=gettz('US/Eastern'))
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/indexes/datetimes/test_setops.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

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

early_dr.union(late_dr)

@td.skip_if_windows_python_3
def test_month_range_union_tz_dateutil(self):
tm._skip_if_windows_python_3()

from pandas._libs.tslibs.timezones import dateutil_gettz
tz = dateutil_gettz('US/Eastern')

Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/indexes/period/test_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import numpy as np

import pandas as pd
import pandas.util._test_decorators as td
from pandas.util import testing as tm
from pandas import (PeriodIndex, period_range, notna, DatetimeIndex, NaT,
Index, Period, Int64Index, Series, DataFrame, date_range,
offsets, compat)
offsets)

from ..datetimelike import DatetimeLike

Expand Down Expand Up @@ -544,9 +545,8 @@ def test_shift_nat(self):
tm.assert_index_equal(result, expected)
assert result.name == expected.name

@td.skip_if_32bit
def test_ndarray_compat_properties(self):
if compat.is_platform_32bit():
pytest.skip("skipping on 32bit")
super(TestPeriodIndex, self).test_ndarray_compat_properties()

def test_shift_ndarray(self):
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/io/parser/c_parser_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import pandas as pd
import pandas.util.testing as tm
import pandas.util._test_decorators as td
from pandas import DataFrame
from pandas import compat
from pandas.compat import StringIO, range, lrange
Expand Down Expand Up @@ -129,9 +130,8 @@ def test_unsupported_dtype(self):
dtype={'A': 'U8'},
index_col=0)

@td.skip_if_32bit
def test_precise_conversion(self):
# see gh-8002
tm._skip_if_32bit()
from decimal import Decimal

normal_errors = []
Expand Down
60 changes: 24 additions & 36 deletions pandas/tests/io/test_pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
isna, compat, concat, Timestamp)

import pandas.util.testing as tm
import pandas.util._test_decorators as td
from pandas.util.testing import (assert_panel4d_equal,
assert_panel_equal,
assert_frame_equal,
assert_series_equal,
set_timezone)

from pandas.compat import (is_platform_windows, is_platform_little_endian,
PY3, PY35, PY36, BytesIO, text_type,
PY35, PY36, BytesIO, text_type,
range, lrange, u)
from pandas.io.formats.printing import pprint_thing
from pandas.core.dtypes.common import is_categorical_dtype
Expand All @@ -40,10 +41,6 @@
LooseVersion('2.2') else 'zlib')


# testing on windows/py3 seems to fault
# for using compression
skip_compression = PY3 and is_platform_windows()

# contextmanager to ensure the file cleanup


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

@td.skip_if_windows_python_3
def test_put_compression_blosc(self):
tm.skip_if_no_package('tables', min_version='2.2',
app='blosc support')
if skip_compression:
pytest.skip("skipping on windows/PY3")

df = tm.makeTimeDataFrame()

with ensure_clean_store(self.path) as store:
Expand Down Expand Up @@ -2892,29 +2887,25 @@ def test_timeseries_preepoch(self):
except OverflowError:
pytest.skip('known failer on some windows platforms')

def test_frame(self):
@pytest.mark.parametrize("compression", [
False, pytest.param(True, marks=td.skip_if_windows_python_3)
])
def test_frame(self, compression):

df = tm.makeDataFrame()

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

self._check_roundtrip_table(df, tm.assert_frame_equal)
self._check_roundtrip(df, tm.assert_frame_equal)

if not skip_compression:
self._check_roundtrip_table(df, tm.assert_frame_equal,
compression=True)
self._check_roundtrip(df, tm.assert_frame_equal,
compression=True)
self._check_roundtrip_table(df, tm.assert_frame_equal,
compression=compression)
self._check_roundtrip(df, tm.assert_frame_equal,
compression=compression)

tdf = tm.makeTimeDataFrame()
self._check_roundtrip(tdf, tm.assert_frame_equal)

if not skip_compression:
self._check_roundtrip(tdf, tm.assert_frame_equal,
compression=True)
self._check_roundtrip(tdf, tm.assert_frame_equal,
compression=compression)

with ensure_clean_store(self.path) as store:
# not consolidated
Expand Down Expand Up @@ -3021,7 +3012,10 @@ def test_store_series_name(self):
recons = store['series']
tm.assert_series_equal(recons, series)

def test_store_mixed(self):
@pytest.mark.parametrize("compression", [
False, pytest.param(True, marks=td.skip_if_windows_python_3)
])
def test_store_mixed(self, compression):

def _make_one():
df = tm.makeDataFrame()
Expand All @@ -3046,19 +3040,12 @@ def _make_one():
tm.assert_frame_equal(store['obj'], df2)

# check that can store Series of all of these types
self._check_roundtrip(df1['obj1'], tm.assert_series_equal)
self._check_roundtrip(df1['bool1'], tm.assert_series_equal)
self._check_roundtrip(df1['int1'], tm.assert_series_equal)

if not skip_compression:
self._check_roundtrip(df1['obj1'], tm.assert_series_equal,
compression=True)
self._check_roundtrip(df1['bool1'], tm.assert_series_equal,
compression=True)
self._check_roundtrip(df1['int1'], tm.assert_series_equal,
compression=True)
self._check_roundtrip(df1, tm.assert_frame_equal,
compression=True)
self._check_roundtrip(df1['obj1'], tm.assert_series_equal,
compression=compression)
self._check_roundtrip(df1['bool1'], tm.assert_series_equal,
compression=compression)
self._check_roundtrip(df1['int1'], tm.assert_series_equal,
compression=compression)

def test_wide(self):

Expand Down Expand Up @@ -5639,6 +5626,7 @@ def test_fixed_offset_tz(self):
tm.assert_index_equal(recons.index, rng)
assert rng.tz == recons.index.tz

@td.skip_if_windows
def test_store_timezone(self):
# GH2852
# issue storing datetime.date with a timezone as it resets when read
Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/scalar/test_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError

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

@td.skip_if_windows
def test_timestamp(self):
# GH#17329
# tz-naive --> treat it as if it were UTC for purposes of timestamp()
Expand Down Expand Up @@ -1366,9 +1368,8 @@ def test_timestamp_to_datetime_explicit_pytz(self):
assert stamp == dtval
assert stamp.tzinfo == dtval.tzinfo

@td.skip_if_windows_python_3
def test_timestamp_to_datetime_explicit_dateutil(self):
tm._skip_if_windows_python_3()

stamp = Timestamp('20090415', tz=gettz('US/Eastern'), freq='D')
dtval = stamp.to_pydatetime()
assert stamp == dtval
Expand Down
6 changes: 2 additions & 4 deletions pandas/tests/sparse/test_libsparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import numpy as np
import operator
import pandas.util.testing as tm

from pandas import compat
import pandas.util._test_decorators as td

from pandas.core.sparse.array import IntIndex, BlockIndex, _make_index
import pandas._libs.sparse as splib
Expand Down Expand Up @@ -190,6 +189,7 @@ def test_intindex_make_union(self):

class TestSparseIndexIntersect(object):

@td.skip_if_windows
def test_intersect(self):
def _check_correct(a, b, expected):
result = a.intersect(b)
Expand All @@ -212,8 +212,6 @@ def _check_case(xloc, xlen, yloc, ylen, eloc, elen):
_check_length_exc(xindex.to_int_index(),
longer_index.to_int_index())

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

def test_intersect_empty(self):
Expand Down
7 changes: 4 additions & 3 deletions pandas/tests/tseries/test_timezones.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from datetime import datetime, timedelta, tzinfo, date

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

@td.skip_if_windows
def test_utc_with_system_utc(self):
# Skipped on win32 due to dateutil bug
tm._skip_if_windows()

from pandas._libs.tslibs.timezones import maybe_get_tz

# from system utc to real utc
Expand Down Expand Up @@ -1270,6 +1269,7 @@ def test_ambiguous_compat(self):
assert (result_pytz.to_pydatetime().tzname() ==
result_dateutil.to_pydatetime().tzname())

@td.skip_if_windows
def test_replace_tzinfo(self):
# GH 15683
dt = datetime(2016, 3, 27, 1)
Expand Down Expand Up @@ -1663,6 +1663,7 @@ def test_normalize_tz(self):
assert result.is_normalized
assert not rng.is_normalized

@td.skip_if_windows
def test_normalize_tz_local(self):
# see gh-13459
timezones = ['US/Pacific', 'US/Eastern', 'UTC', 'Asia/Kolkata',
Expand Down
12 changes: 3 additions & 9 deletions pandas/tests/util/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import sys
from pandas import Series, DataFrame
import pandas.util.testing as tm
import pandas.util._test_decorators as td
from pandas.util.testing import (assert_almost_equal, raise_with_traceback,
assert_index_equal, assert_series_equal,
assert_frame_equal, assert_numpy_array_equal,
RNGContext)
from pandas.compat import is_platform_windows


class TestAssertAlmostEqual(object):
Expand Down Expand Up @@ -159,12 +159,9 @@ def test_raise_with_traceback(self):

class TestAssertNumpyArrayEqual(object):

@td.skip_if_windows
def test_numpy_array_equal_message(self):

if is_platform_windows():
pytest.skip("windows has incomparable line-endings "
"and uses L on the shape")

expected = """numpy array are different

numpy array shapes are different
Expand Down Expand Up @@ -287,12 +284,9 @@ def test_numpy_array_equal_message(self):
assert_almost_equal(np.array([1, 2]), np.array([3, 4, 5]),
obj='Index')

@td.skip_if_windows
def test_numpy_array_equal_object_message(self):

if is_platform_windows():
pytest.skip("windows has incomparable line-endings "
"and uses L on the shape")

a = np.array([pd.Timestamp('2011-01-01'), pd.Timestamp('2011-01-01')])
b = np.array([pd.Timestamp('2011-01-01'), pd.Timestamp('2011-01-02')])

Expand Down
Loading