8000 Add tests · dstansby/matplotlib@b1b6bea · GitHub
[go: up one dir, main page]

Skip to 8000 content

Commit b1b6bea

Browse files
committed
Add tests
1 parent 5a33bcc commit b1b6bea

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lib/matplotlib/tests/test_testing.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import warnings
2+
23
import pytest
4+
5+
import matplotlib.pyplot as plt
36
from matplotlib.testing.decorators import check_figures_equal
47

58

@@ -22,3 +25,17 @@ def test_wrap_failure():
2225
@check_figures_equal()
2326
def should_fail(test, ref):
2427
pass
28+
29+
30+
@pytest.mark.xfail(raises=RuntimeError, strict=True,
31+
reason='Test for check_figures_equal test creating '
32+
'new figures')
33+
@check_figures_equal()
34+
def test_check_figures_equal_extra_fig(fig_test, fig_ref):
35+
plt.figure()
36+
37+
38+
@check_figures_equal()
39+
def test_check_figures_equal_closed_fig(fig_test, fig_ref):
40+
fig = plt.figure()
41+
plt.close(fig)

0 commit comments

Comments
 (0)
0