Skip to content

Commit da89e1b

Browse files
cleanup str type cast remaining cases
1 parent 4dfad67 commit da89e1b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pandas/tests/io/formats/test_to_csv.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,8 @@ def test_to_csv_compression_dict_no_method_raises(self, temp_file):
567567
compression = {"some_option": True}
568568
msg = "must have key 'method'"
569569

570-
path = str(temp_file)
571570
with pytest.raises(ValueError, match=msg):
572-
df.to_csv(path, compression=compression)
571+
df.to_csv(temp_file, compression=compression)
573572

574573
@pytest.mark.parametrize("compression", ["zip", "infer"])
575574
@pytest.mark.parametrize("archive_name", ["test_to_csv.csv", "test_to_csv.zip"])
@@ -692,8 +691,7 @@ def test_to_csv_encoding_binary_handle(self, mode, temp_file):
692691
assert buffer.getvalue().startswith(content)
693692

694693
# example from GH 13068
695-
path = str(temp_file)
696-
with open(path, "w+b") as handle:
694+
with open(temp_file, "w+b") as handle:
697695
DataFrame().to_csv(handle, mode=mode, encoding="utf-8-sig")
698696

699697
handle.seek(0)

0 commit comments

Comments
 (0)