Skip to content

Commit b8e23c4

Browse files
python 2 unittest doesn't support assertRaisesRegex
1 parent a62225a commit b8e23c4

File tree

1 file changed

+6
-1
lines changed
  • packages/python/plotly/plotly/tests/test_core/test_graph_objs

1 file changed

+6
-1
lines changed

Diff for: packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_figure.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -215,5 +215,10 @@ def test_set_subplots(self):
215215
)
216216
assert fig1.layout == fig1_sp.layout
217217
# Test that calling on a figure that already has subplots throws an error.
218-
with self.assertRaisesRegex(ValueError, "^This figure already has subplots\.$"):
218+
raised = False
219+
try:
219220
fig1.set_subplots(2, 3)
221+
except ValueError as e:
222+
assert e.args[0] == "This figure already has subplots."
223+
raised = True
224+
assert raised

0 commit comments

Comments
 (0)