17
17
isna , compat , concat , Timestamp )
18
18
19
19
import pandas .util .testing as tm
20
+ import pandas .util ._test_decorators as td
20
21
from pandas .util .testing import (assert_panel4d_equal ,
21
22
assert_panel_equal ,
22
23
assert_frame_equal ,
40
41
LooseVersion ('2.2' ) else 'zlib' )
41
42
42
43
43
- # testing on windows/py3 seems to fault
44
- # for using compression
45
- skip_compression = PY3 and is_platform_windows ()
46
-
47
44
# contextmanager to ensure the file cleanup
48
45
49
46
@@ -719,12 +716,10 @@ def test_put_compression(self):
719
716
pytest .raises (ValueError , store .put , 'b' , df ,
720
717
format = 'fixed' , complib = 'zlib' )
721
718
719
+ @td .skip_if_windows_python_3
722
720
def test_put_compression_blosc (self ):
723
721
tm .skip_if_no_package ('tables' , min_version = '2.2' ,
724
722
app = 'blosc support' )
725
- if skip_compression :
726
- pytest .skip ("skipping on windows/PY3" )
727
-
728
723
df = tm .makeTimeDataFrame ()
729
724
730
725
with ensure_clean_store (self .path ) as store :
@@ -2892,29 +2887,26 @@ def test_timeseries_preepoch(self):
2892
2887
except OverflowError :
2893
2888
pytest .skip ('known failer on some windows platforms' )
2894
2889
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 ):
2896
2895
2897
2896
df = tm .makeDataFrame ()
2898
2897
2899
2898
# put in some random NAs
2900
2899
df .values [0 , 0 ] = np .nan
2901
2900
df .values [5 , 3 ] = np .nan
2902
2901
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 )
2911
2906
2912
2907
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 )
2918
2910
2919
2911
with ensure_clean_store (self .path ) as store :
2920
2912
# not consolidated
@@ -3021,7 +3013,11 @@ def test_store_series_name(self):
3021
3013
recons = store ['series' ]
3022
3014
tm .assert_series_equal (recons , series )
3023
3015
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 ):
3025
3021
3026
3022
def _make_one ():
3027
3023
df = tm .makeDataFrame ()
@@ -3046,19 +3042,12 @@ def _make_one():
3046
3042
tm .assert_frame_equal (store ['obj' ], df2 )
3047
3043
3048
3044
# 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 )
3062
3051
3063
3052
def test_wide (self ):
3064
3053
@@ -5620,6 +5609,7 @@ def test_fixed_offset_tz(self):
5620
5609
tm .assert_index_equal (recons .index , rng )
5621
5610
assert rng .tz == recons .index .tz
5622
5611
5612
+ @td .skip_if_windows
5623
5613
def test_store_timezone (self ):
5624
5614
# GH2852
5625
5615
# issue storing datetime.date with a timezone as it resets when read
0 commit comments