Skip to content

Commit f54510d

Browse files
Raisa DzhamtyrovaRaisa Dzhamtyrova
Raisa Dzhamtyrova
authored and
Raisa Dzhamtyrova
committed
change error message in test_to_dict.py
1 parent dda42be commit f54510d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/tests/frame/methods/test_to_dict.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ def test_to_dict(self, mapping):
132132
def test_to_dict_errors(self, mapping):
133133
# GH#16122
134134
df = DataFrame(np.random.randn(3, 3))
135-
msg = (
136-
r"(:?unsupported type: <class 'list'\>)"
137-
r"|(:?to_dict\(\) only accepts initialized defaultdicts)"
135+
msg = "|".join(
136+
[
137+
"unsupported type: <class 'list'>",
138+
r"to_dict\(\) only accepts initialized defaultdicts",
139+
]
138140
)
139141
with pytest.raises(TypeError, match=msg):
140142
df.to_dict(into=mapping)

0 commit comments

Comments
 (0)