Skip to content

Commit 1fb310d

Browse files
committed
remove dummy files
1 parent 2df3c43 commit 1fb310d

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

tests/test_frame.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,10 @@ def test_types_to_csv() -> None:
110110

111111
def test_types_to_csv_when_path_passed() -> None:
112112
df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]})
113-
path: Path = Path("./dummy_path.txt")
114-
try:
115-
assert not path.exists()
113+
with ensure_clean() as file:
114+
path = Path(file)
116115
df.to_csv(path)
117116
df5: pd.DataFrame = pd.read_csv(path)
118-
finally:
119-
path.unlink()
120117

121118

122119
def test_types_copy() -> None:
@@ -788,16 +785,17 @@ def test_to_markdown() -> None:
788785
def test_types_to_feather() -> None:
789786
pytest.importorskip("pyarrow")
790787
df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [3, 4, 5]})
791-
df.to_feather("dummy_path")
792-
# kwargs for pyarrow.feather.write_feather added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html
793-
df.to_feather("dummy_path", compression="zstd", compression_level=3, chunksize=2)
794-
795-
# to_feather has been able to accept a buffer since pandas 1.0.0
796-
# See https://pandas.pydata.org/docs/whatsnew/v1.0.0.html
797-
# Docstring and type were updated in 1.2.0.
798-
# https://github.com/pandas-dev/pandas/pull/35408
799788
with ensure_clean() as path:
800789
df.to_feather(path)
790+
# kwargs for pyarrow.feather.write_feather added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html
791+
df.to_feather(path, compression="zstd", compression_level=3, chunksize=2)
792+
793+
# to_feather has been able to accept a buffer since pandas 1.0.0
794+
# See https://pandas.pydata.org/docs/whatsnew/v1.0.0.html
795+
# Docstring and type were updated in 1.2.0.
796+
# https://github.com/pandas-dev/pandas/pull/35408
797+
with open(path, mode="wb") as file:
798+
df.to_feather(file)
801799

802800

803801
# compare() method added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html

0 commit comments

Comments
 (0)