Skip to content

Commit 86c1241

Browse files
committed
fixed test_new_style_with_mixed_types_in_column added match to assert_produces_warning
1 parent 64e0c56 commit 86c1241

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/tests/io/formats/test_to_csv.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,9 @@ def test_new_style_with_mixed_types():
780780

781781
def test_new_style_with_mixed_types_in_column():
782782
df = DataFrame({"A": [1.23, "text", 4.56]})
783-
with tm.assert_produces_warning(UserWarning):
783+
with tm.assert_produces_warning(
784+
UserWarning, match="could not convert string to float"
785+
):
784786
result = df.to_csv(float_format="{:.2f}", lineterminator="\n")
785787

786788
expected = ",A\n0,1.23\n1,text\n2,4.56\n"

0 commit comments

Comments
 (0)