File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
pandas/tests/frame/methods Expand file tree Collapse file tree 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):
14061406 expected = tm .convert_rows_list_to_csv_str (expected_rows )
14071407 assert result == expected
14081408
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 ):
14101410 # GH57875
14111411 df = DataFrame ({"a" : [1 , 2 , 3 ]})
14121412 msg = (
14131413 "zip and tar do not support mode 'a' properly. This combination will "
14141414 "result in multiple files with same name being added to the archive"
14151415 )
1416+ zip_path = tmp_path / "test.zip"
1417+ tar_path = tmp_path / "test.tar"
14161418 with tm .assert_produces_warning (
14171419 RuntimeWarning , match = msg , raise_on_extra_warnings = False
14181420 ):
1419- df .to_csv ("test.zip" , mode = "a" )
1421+ df .to_csv (zip_path , mode = "a" )
14201422
14211423 with tm .assert_produces_warning (
14221424 RuntimeWarning , match = msg , raise_on_extra_warnings = False
14231425 ):
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