File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -134,10 +134,13 @@ def save(self):
134
134
encoding = self .encoding
135
135
136
136
# GH 21227 internal compression is not used when file-like passed.
137
- print ('debug_3' , self .compression )
138
- print ('debug_4' , self .path_or_buf )
139
- print ('debug_5' , hasattr (self .path_or_buf , 'write' ))
137
+ import logging
138
+ logging .warning ('debug_3: {}' .format (self .compression ))
139
+ logging .warning ('debug_4: {}' .format (self .path_or_buf ))
140
+ logging .warning (
141
+ 'debug_5: {}' .format (hasattr (self .path_or_buf , 'write' )))
140
142
if self .compression and hasattr (self .path_or_buf , 'write' ):
143
+ logging .warning ('debug_6: in loop, should RuntimeWarn' )
141
144
msg = ("compression has no effect when passing file-like "
142
145
"object as input." )
143
146
warnings .warn (msg , RuntimeWarning , stacklevel = 2 )
Original file line number Diff line number Diff line change @@ -257,10 +257,11 @@ def test_compression_warning(compression_only):
257
257
[12.32112 , 123123.2 , 321321.2 ]],
258
258
columns = ['X' , 'Y' , 'Z' ])
259
259
with tm .ensure_clean () as filename :
260
- print ('debug_1' , compression_only )
260
+ import logging
261
+ logging .warning ('debug_1: {}' .format (compression_only ))
261
262
f , _handles = _get_handle (filename , 'w' , compression = compression_only )
262
263
with tm .assert_produces_warning (RuntimeWarning ,
263
264
check_stacklevel = False ):
264
265
with f :
265
- print ('debug_2' , compression_only )
266
+ logging . warning ('debug_2: {}' . format ( compression_only ) )
266
267
df .to_csv (f , compression = compression_only )
You can’t perform that action at this time.
0 commit comments