Skip to content

Commit

Permalink
CI: Fix line sep issue in to_csv test (pandas-dev#46024)
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl authored Feb 16, 2022
1 parent 6dc2b94 commit 9cc98a0
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions pandas/tests/io/formats/test_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,25 +320,19 @@ def test_to_csv_float_ea_float_format(self):
df = DataFrame({"a": [1.1, 2.02, pd.NA, 6.000006], "b": "c"})
df["a"] = df["a"].astype("Float64")
result = df.to_csv(index=False, float_format="%.5f")
expected = """a,b
1.10000,c
2.02000,c
,c
6.00001,c
"""
expected = tm.convert_rows_list_to_csv_str(
["a,b", "1.10000,c", "2.02000,c", ",c", "6.00001,c"]
)
assert result == expected

def test_to_csv_float_ea_no_float_format(self):
# GH#45991
df = DataFrame({"a": [1.1, 2.02, pd.NA, 6.000006], "b": "c"})
df["a"] = df["a"].astype("Float64")
result = df.to_csv(index=False)
expected = """a,b
1.1,c
2.02,c
,c
6.000006,c
"""
expected = tm.convert_rows_list_to_csv_str(
["a,b", "1.1,c", "2.02,c", ",c", "6.000006,c"]
)
assert result == expected

def test_to_csv_multi_index(self):
Expand Down

0 comments on commit 9cc98a0

Please sign in to comment.