Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6f67cd7

Browse files
Forego regex matching for just matching the string verbatim
1 parent 2ef6c04 commit 6f67cd7

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

packages/python/plotly/plotly/tests/test_core/test_subplots/test_make_subplots.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,20 @@ def test_row_width_not_list_of_correct_numbers(self):
115115
tls.make_subplots(rows=2, cols=2, row_heights=[1])
116116

117117
def test_bad_row_spacing(self):
118-
with self.assertRaisesRegex(
119-
ValueError, "Vertical spacing must be less than or equal to 1 / (rows - 1)."
120-
):
118+
with self.assertRaises(ValueError) as cm:
121119
tls.make_subplots(rows=3, vertical_spacing=1 / 2 + 1e-6)
120+
assert (
121+
cm.exception.args[0]
122+
== "Vertical spacing must be less than or equal to 1 / (rows - 1)."
123+
)
122124

123125
def test_bad_col_spacing(self):
124-
with self.assertRaisesRegex(
125-
ValueError,
126-
"Horizontal spacing must be less than or equal to 1 / (cols - 1).",
127-
):
126+
with self.assertRaises(ValueError) as cm:
128127
tls.make_subplots(cols=3, horizontal_spacing=1 / 2 + 1e-6)
128+
assert (
129+
cm.exception.args[0]
130+
== "Horizontal spacing must be less than or equal to 1 / (cols - 1)."
131+
)
129132

130133
def test_single_plot(self):
131134
expected = Figure(

0 commit comments

Comments
 (0)