Skip to content

Commit 9566b42

Browse files
committed
feedback: test roundtrip w/o writing to file
1 parent 930f0e1 commit 9566b42

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pandas/tests/io/test_parquet.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -515,13 +515,11 @@ def test_basic_subset_columns(self, pa, df_full):
515515
def test_to_bytes_without_path_or_buf_provided(self, pa, df_full):
516516
# GH 37105
517517

518-
buf = df_full.to_parquet(engine=pa)
519-
assert isinstance(buf, bytes)
518+
buf_bytes = df_full.to_parquet(engine=pa)
519+
assert isinstance(buf_bytes, bytes)
520520

521-
with tm.ensure_clean() as path:
522-
with open(path, "wb") as f:
523-
f.write(buf)
524-
res = pd.read_parquet(path)
521+
buf_stream = BytesIO(buf_bytes)
522+
res = pd.read_parquet(buf_stream)
525523

526524
tm.assert_frame_equal(df_full, res)
527525

0 commit comments

Comments
 (0)