@@ -274,20 +274,20 @@ def test_dataframe_compression_defaults_to_infer(
274
274
tm .assert_frame_equal (output , input )
275
275
276
276
277
- @pytest .mark .parametrize ('write_method, read_method, read_kwargs' , [
278
- ('to_csv' , pandas .Series . from_csv , {}),
279
- ('to_json' , pandas .read_json , {'typ' : 'series' }),
280
- ('to_pickle' , pandas .read_pickle , {}),
277
+ @pytest .mark .parametrize ('write_method,write_kwargs, read_method,read_kwargs' , [
278
+ ('to_csv' , { 'index' : False , 'header' : True }, pandas .read_csv , {'squeeze' : True }),
279
+ ('to_json' , {}, pandas .read_json , {'typ' : 'series' }),
280
+ ('to_pickle' , {}, pandas .read_pickle , {}),
281
281
])
282
282
def test_series_compression_defaults_to_infer (
283
- write_method , read_method , read_kwargs , compression_only ):
283
+ write_method , write_kwargs , read_method , read_kwargs , compression_only ):
284
284
# Test that Series.to_* methods default to inferring compression from
285
285
# paths. https://github.com/pandas-dev/pandas/pull/22011
286
- input = Series (100 * [0 , 5 , - 2 , 10 ])
286
+ input = Series ([0 , 5 , - 2 , 10 ], name = 'X' )
287
287
extension = _compression_to_extension [compression_only ]
288
288
with tm .ensure_clean ('compressed' + extension ) as path :
289
289
# assumes that compression='infer' is the default
290
- getattr (input , write_method )(path )
290
+ getattr (input , write_method )(path , ** write_kwargs )
291
291
output = read_method (path , compression = compression_only , ** read_kwargs )
292
292
tm .assert_series_equal (output , input )
293
293
0 commit comments