Skip to content

Commit

Permalink
Debugging print statements
Browse files Browse the repository at this point in the history
Attempt to diagnose testing failure of Python 2 test_compression_warning
https://travis-ci.org/pandas-dev/pandas/jobs/407300547#L3853
  • Loading branch information
dhimmel committed Jul 23, 2018
1 parent 868e671 commit c3b76ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pandas/io/formats/csvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def save(self):
encoding = self.encoding

# GH 21227 internal compression is not used when file-like passed.
print('debug_3', self.compression)
print('debug_4', self.path_or_buf)
print('debug_5', hasattr(self.path_or_buf, 'write'))
if self.compression and hasattr(self.path_or_buf, 'write'):
msg = ("compression has no effect when passing file-like "
"object as input.")
Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,10 @@ def test_compression_warning(compression_only):
[12.32112, 123123.2, 321321.2]],
columns=['X', 'Y', 'Z'])
with tm.ensure_clean() as filename:
print('debug_1', compression_only)
f, _handles = _get_handle(filename, 'w', compression=compression_only)
with tm.assert_produces_warning(RuntimeWarning,
check_stacklevel=False):
with f:
print('debug_2', compression_only)
df.to_csv(f, compression=compression_only)

0 comments on commit c3b76ee

Please sign in to comment.