Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions pandas/tests/io/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,18 @@ def test_write_fspath_all(self, writer_name, writer_kwargs, module):
writer = getattr(df, writer_name)

writer(string, **writer_kwargs)
with open(string, "rb") as f:
expected = f.read()

writer(mypath, **writer_kwargs)
with open(fspath, "rb") as f:
result = f.read()

assert result == expected
with open(string, "rb") as f_str, open(fspath, "rb") as f_path:
if writer == "to_excel":
# binary representation of excel contains time creation
# data that causes flaky CI failures
result = pd.read_excel(f_str, **writer_kwargs)
expected = pd.read_excel(f_path, **writer_kwargs)
tm.assert_frame_equal(result, expected)
else:
result = f_str.read()
expected = f_path.read()
assert result == expected

@pytest.mark.filterwarnings( # pytables np.object usage
"ignore:`np.object` is a deprecated alias:DeprecationWarning"
Expand Down