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

Skip to content

Commit 87066ba

Browse files
committed
Made test more versatile
1 parent 87732e8 commit 87066ba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/tests/test_pyplot.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,9 @@ def test_figure_hook():
460460

461461

462462
def test_multiple_same_figure_calls():
463+
fig = mpl.pyplot.figure(1, figsize=(1, 2))
463464
with pytest.warns(UserWarning, match="Ignoring specified arguments in this call"):
464-
fig = mpl.pyplot.figure(1, figsize=(1, 2))
465-
fig = mpl.pyplot.figure(1, figsize=(3, 4))
465+
fig2 = mpl.pyplot.figure(1, figsize=(3, 4))
466+
assert fig is fig2
467+
fig3 = mpl.pyplot.figure(1) # Checks for false warnings
468+
assert fig is fig3

0 commit comments

Comments
 (0)