@@ -221,8 +221,7 @@ def test_standardize_mapping():
221
221
Series (100 * [0.123456 , 0.234567 , 0.567567 ], name = 'X' )])
222
222
@pytest .mark .parametrize ('method' , ['to_pickle' , 'to_json' , 'to_csv' ])
223
223
def test_compression_size (obj , method , compression_only ):
224
- # Tests that compression is occurring by comparing to the bytes on disk of
225
- # the uncompressed file.
224
+
226
225
with tm .ensure_clean () as filename :
227
226
getattr (obj , method )(filename , compression = compression_only )
228
227
compressed = os .path .getsize (filename )
@@ -264,11 +263,10 @@ def test_compression_size_fh(obj, method, compression_only):
264
263
def test_dataframe_compression_defaults_to_infer (
265
264
write_method , write_kwargs , read_method , compression_only ):
266
265
# Test that DataFrame.to_* methods default to inferring compression from
267
- # paths. https://github.com/pandas-dev/pandas/pull/22011
266
+ # paths. GH 22004
268
267
input = DataFrame ([[1.0 , 0 , - 4.4 ], [3.4 , 5 , 2.4 ]], columns = ['X' , 'Y' , 'Z' ])
269
268
extension = _compression_to_extension [compression_only ]
270
269
with tm .ensure_clean ('compressed' + extension ) as path :
271
- # assumes that compression='infer' is the default
272
270
getattr (input , write_method )(path , ** write_kwargs )
273
271
output = read_method (path , compression = compression_only )
274
272
tm .assert_frame_equal (output , input )
@@ -284,20 +282,18 @@ def test_series_compression_defaults_to_infer(
284
282
write_method , write_kwargs , read_method , read_kwargs ,
285
283
compression_only ):
286
284
# Test that Series.to_* methods default to inferring compression from
287
- # paths. https://github.com/pandas-dev/pandas/pull/22011
285
+ # paths. GH 22004
288
286
input = Series ([0 , 5 , - 2 , 10 ], name = 'X' )
289
287
extension = _compression_to_extension [compression_only ]
290
288
with tm .ensure_clean ('compressed' + extension ) as path :
291
- # assumes that compression='infer' is the default
292
289
getattr (input , write_method )(path , ** write_kwargs )
293
290
output = read_method (path , compression = compression_only , ** read_kwargs )
294
291
tm .assert_series_equal (output , input , check_names = False )
295
292
296
293
297
294
def test_compression_warning (compression_only ):
298
295
# Assert that passing a file object to to_csv while explicitly specifying a
299
- # compression protocol triggers a RuntimeWarning, as per
300
- # https://github.com/pandas-dev/pandas/issues/21227.
296
+ # compression protocol triggers a RuntimeWarning, as per GH 21227.
301
297
# Note that pytest has an issue that causes assert_produces_warning to fail
302
298
# in Python 2 if the warning has occurred in previous tests
303
299
# (see https://git.io/fNEBm & https://git.io/fNEBC). Hence, should this
0 commit comments