File tree 1 file changed +5
-3
lines changed
pandas/tests/frame/methods
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1406,19 +1406,21 @@ def test_to_csv_categorical_and_interval(self):
1406
1406
expected = tm .convert_rows_list_to_csv_str (expected_rows )
1407
1407
assert result == expected
1408
1408
1409
- def test_to_csv_warn_when_zip_tar_and_append_mode (self ):
1409
+ def test_to_csv_warn_when_zip_tar_and_append_mode (self , tmp_path ):
1410
1410
# GH57875
1411
1411
df = DataFrame ({"a" : [1 , 2 , 3 ]})
1412
1412
msg = (
1413
1413
"zip and tar do not support mode 'a' properly. This combination will "
1414
1414
"result in multiple files with same name being added to the archive"
1415
1415
)
1416
+ zip_path = tmp_path / "test.zip"
1417
+ tar_path = tmp_path / "test.tar"
1416
1418
with tm .assert_produces_warning (
1417
1419
RuntimeWarning , match = msg , raise_on_extra_warnings = False
1418
1420
):
1419
- df .to_csv ("test.zip" , mode = "a" )
1421
+ df .to_csv (zip_path , mode = "a" )
1420
1422
1421
1423
with tm .assert_produces_warning (
1422
1424
RuntimeWarning , match = msg , raise_on_extra_warnings = False
1423
1425
):
1424
- df .to_csv ("test.tar" , mode = "a" )
1426
+ df .to_csv (tar_path , mode = "a" )
You can’t perform that action at this time.
0 commit comments