Skip to content

Commit

Permalink
✅ update tests so they test Series.to_markdown as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Gorelli committed Dec 20, 2019
1 parent bcb4833 commit 8e98324
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pandas/tests/io/formats/test_to_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ def test_other_tablefmt(self):
def test_other_headers(self):
df = pd.DataFrame([1, 2, 3])
result = df.to_markdown(headers=["foo", "bar"])
assert (
result
== "| foo | bar |\n|------:|------:|\n| 0 | 1 |\n| 1 | 2 |\n| 2 | 3 |"
assert result == (
"| foo | bar |\n|------:|------:|\n| 0 "
"| 1 |\n| 1 | 2 |\n| 2 | 3 |"
)

def test_series(self):
s = pd.Series([1, 2, 3], name="foo")
result = s.to_markdown()
assert (
result
== "| | foo |\n|---:|------:|\n| 0 | 1 |\n| 1 | 2 |\n| 2 | 3 |"
assert result == (
"| | foo |\n|---:|------:|\n| 0 | 1 "
"|\n| 1 | 2 |\n| 2 | 3 |"
)

0 comments on commit 8e98324

Please sign in to comment.