8000 Add @cleanup decorator to new contour tests · matplotlib/matplotlib@223d75a · GitHub
[go: up one dir, main page]

Skip to content

Commit 223d75a

Browse files
committed
Add @cleanup decorator to new contour tests
1 parent 4910610 commit 223d75a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/tests/test_contour.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import numpy as np
2+
3+
from matplotlib.testing.decorators import cleanup
24
from matplotlib import pyplot as plt
35

46

7+
@cleanup
58
def test_contour_shape_1d_valid():
69

710
x = np.arange(10)
@@ -13,6 +16,7 @@ def test_contour_shape_1d_valid():
1316
ax.contour(x, y, z)
1417

1518

19+
@cleanup
1620
def test_contour_shape_2d_valid():
1721

1822
x = np.arange(10)
@@ -25,6 +29,7 @@ def test_contour_shape_2d_valid():
2529
ax.contour(xg, yg, z)
2630

2731

32+
@cleanup
2833
def test_contour_shape_mismatch_1():
2934

3035
x = np.arange(9)
@@ -40,6 +45,7 @@ def test_contour_shape_mismatch_1():
4045
assert exc.args[0] == 'Length of x must be number of columns in z.'
4146

4247

48+
@cleanup
4349
def test_contour_shape_mismatch_2():
4450

4551
x = np.arange(10)
@@ -55,6 +61,7 @@ def test_contour_shape_mismatch_2():
5561
assert exc.args[0] == 'Length of y must be number of rows in z.'
5662

5763

64+
@cleanup
5865
def test_contour_shape_mismatch_3():
5966

6067
x = np.arange(10)
@@ -76,6 +83,7 @@ def test_contour_shape_mismatch_3():
7683
assert exc.args[0] == 'Number of dimensions of x and y should match.'
7784

7885

86+
@cleanup
7987
def test_contour_shape_mismatch_4():
8088

8189
g = np.random.random((9, 10))
@@ -97,6 +105,7 @@ def test_contour_shape_mismatch_4():
97105
assert exc.args[0] == 'Shape of y does not match that of z: found (9, 9) instead of (9, 10).'
98106

99107

108+
@cleanup
100109
def test_contour_shape_invalid_1():
101110

102111
x = np.random.random((3, 3, 3))
@@ -112,6 +121,7 @@ def test_contour_shape_invalid_1():
112121
assert exc.args[0] == 'Inputs x and y must be 1D or 2D.'
113122

114123

124+
@cleanup
115125
def test_contour_shape_invalid_2():
116126

117127
x = np.random.random((3, 3, 3))

0 commit comments

Comments
 (0)
0