Skip to content

Commit 10df8b4

Browse files
Converted tests for string comparisons
1 parent 6391b76 commit 10df8b4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/tests/io/formats/test_printing.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
@pytest.mark.parametrize(
1616
"input_names, expected_names",
1717
[
18-
(["'a", "b"], ["'a", "b"]), # Escape leading quote
19-
(["test's", "b"], ["test's", "b"]), # Escape apostrophe
20-
(["'test'", "b"], ["'test'", "b"]), # Escape surrounding quotes
21-
(["test", "b'"], ["test", "b'"]), # Escape single quote
22-
(["'test\n'", "b"], ["'test\n'", "b"]), # Escape and preserve newline
18+
(["'a b"], "['\\'a b']"), # Escape leading quote
19+
(["test's b"], "['test\\'s b']"), # Escape apostrophe
20+
(["'test' b"], "['\\'test\\' b']"), # Escape surrounding quotes
21+
(["test b'"], "['test b\\'']"), # Escape single quote
22+
(["test\n' b"], "['test\\n\\' b']"), # Escape quotes, preserve newline
2323
],
2424
)
2525
def test_formatted_index_names(input_names, expected_names):
2626
# GH#60190
2727
df = pd.DataFrame({name: [1, 2, 3] for name in input_names}).set_index(input_names)
28-
formatted_names = df.index.names
28+
formatted_names = str(df.index.names)
2929

3030
assert formatted_names == expected_names
3131

0 commit comments

Comments
 (0)