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 ,
23
24
assert_series_equal ,
24
25
set_timezone )
25
26
26
27
from pandas .compat import (is_platform_windows , is_platform_little_endian ,
27
- PY3 , PY35 , PY36 , BytesIO , text_type ,
28
+ PY35 , PY36 , BytesIO , text_type ,
28
29
range , lrange , u )
29
30
from pandas .io .formats .printing import pprint_thing
30
31
from pandas .core .dtypes .common import is_categorical_dtype
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,25 @@ 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 , pytest .param (True , marks = td .skip_if_windows_python_3 )
2892
+ ])
2893
+ def test_frame (self , compression ):
2896
2894
2897
2895
df = tm .makeDataFrame ()
2898
2896
2899
2897
# put in some random NAs
2900
2898
df .values [0 , 0 ] = np .nan
2901
2899
df .values [5 , 3 ] = np .nan
2902
2900
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 )
2901
+ self ._check_roundtrip_table (df , tm .assert_frame_equal ,
2902
+ compression = compression )
2903
+ self ._check_roundtrip (df , tm .assert_frame_equal ,
2904
+ compression = compression )
2911
2905
2912
2906
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 )
2907
+ self ._check_roundtrip (tdf , tm .assert_frame_equal ,
2908
+ compression = compression )
2918
2909
2919
2910
with ensure_clean_store (self .path ) as store :
2920
2911
# not consolidated
@@ -3021,7 +3012,10 @@ def test_store_series_name(self):
3021
3012
recons = store ['series' ]
3022
3013
tm .assert_series_equal (recons , series )
3023
3014
3024
- def test_store_mixed (self ):
3015
+ @pytest .mark .parametrize ("compression" , [
3016
+ False , pytest .param (True , marks = td .skip_if_windows_python_3 )
3017
+ ])
3018
+ def test_store_mixed (self , compression ):
3025
3019
3026
3020
def _make_one ():
3027
3021
df = tm .makeDataFrame ()
@@ -3046,19 +3040,12 @@ def _make_one():
3046
3040
tm .assert_frame_equal (store ['obj' ], df2 )
3047
3041
3048
3042
# 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 )
3043
+ self ._check_roundtrip (df1 ['obj1' ], tm .assert_series_equal ,
3044
+ compression = compression )
3045
+ self ._check_roundtrip (df1 ['bool1' ], tm .assert_series_equal ,
3046
+ compression = compression )
3047
+ self ._check_roundtrip (df1 ['int1' ], tm .assert_series_equal ,
3048
+ compression = compression )
3062
3049
3063
3050
def test_wide (self ):
3064
3051
@@ -5639,6 +5626,7 @@ def test_fixed_offset_tz(self):
5639
5626
tm .assert_index_equal (recons .index , rng )
5640
5627
assert rng .tz == recons .index .tz
5641
5628
5629
+ @td .skip_if_windows
5642
5630
def test_store_timezone (self ):
5643
5631
# GH2852
5644
5632
# issue storing datetime.date with a timezone as it resets when read
0 commit comments