Skip to content

Commit b34cadb

Browse files
author
Marco Gorelli
committed
✅ update tests so they work with **kwargs, set skip_if_no_tabulate to whole class
1 parent 88e7bc2 commit b34cadb

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

pandas/tests/io/formats/test_to_markdown.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44

55

66
@td.skip_if_no_tabulate
7-
def test_to_markdown():
8-
df = pd.DataFrame([1, 2, 3])
9-
result = df.to_markdown()
10-
assert (
11-
result == "| | 0 |\n|---:|----:|\n| 0 | 1 |\n| 1 | 2 |\n| 2 | 3 |"
12-
)
7+
class TestToMarkdown:
8+
def test_to_markdown(self):
9+
df = pd.DataFrame([1, 2, 3])
10+
result = df.to_markdown()
11+
assert (
12+
result
13+
== "| | 0 |\n|---:|----:|\n| 0 | 1 |\n| 1 | 2 |\n| 2 | 3 |"
14+
)
15+
16+
def test_to_markdown_other_tablefmt(self):
17+
df = pd.DataFrame([1, 2, 3])
18+
result = df.to_markdown(tablefmt="jira")
19+
assert result == "|| || 0 ||\n| 0 | 1 |\n| 1 | 2 |\n| 2 | 3 |"

0 commit comments

Comments
 (0)