Skip to content

Commit b219589

Browse files
committed
TST: fix test
1 parent 6cf9c20 commit b219589

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/matplotlib/figure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2242,7 +2242,7 @@ def __init__(self,
22422242
constrained_layout is not None):
22432243
_api.warn_external(
22442244
"The Figure parameters 'layout' and 'tight_layout' or "
2245-
"'constrained_layout cannot be used together. Please use "
2245+
"'constrained_layout' cannot be used together. Please use "
22462246
"'layout' only.")
22472247
self.set_layout_engine(layout=layout)
22482248
elif tight_layout is not None:

lib/matplotlib/tests/test_figure.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,12 +526,11 @@ def test_invalid_layouts():
526526

527527
# Using layout + (tight|constrained)_layout warns, but the former takes
528528
# precedence.
529-
with pytest.warns(UserWarning, match="Figure parameters 'layout' and "
530-
"'tight_layout' cannot"):
529+
wst = "The Figure parameters 'layout' and 'tight_layout' or "
530+
with pytest.warns(UserWarning, match=wst):
531531
fig = Figure(layout='tight', tight_layout=False)
532532
assert isinstance(fig.get_layout_engine(), tight_layout_engine)
533-
with pytest.warns(UserWarning, match="Figure parameters 'layout' and "
534-
"'constrained_layout' cannot"):
533+
with pytest.warns(UserWarning, match=wst):
535534
fig = Figure(layout='constrained', constrained_layout=False)
536535
assert not isinstance(fig.get_layout_engine(), tight_layout_engine)
537536
assert isinstance(fig.get_layout_engine(), constrained_layout_engine)

0 commit comments

Comments
 (0)