8000 Added test for warning · matplotlib/matplotlib@a9e9723 · GitHub
[go: up one dir, main page]

Skip to content

Commit a9e9723

Browse files
committed
Added test for warning
Made test more versatile
1 parent d41b048 commit a9e9723

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/matplotlib/tests/test_pyplot.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,3 +457,12 @@ def test_figure_hook():
457457< 8475 /code>
fig = plt.figure()
458458

459459
assert fig._test_was_here
460+
461+
462+
def test_multiple_same_figure_calls():
463+
fig = mpl.pyplot.figure(1, figsize=(1, 2))
464+
with pytest.warns(UserWarning, match="Ignoring specified arguments in this call"):
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)
0