1
1
import numpy as np
2
+
3
+ from matplotlib .testing .decorators import cleanup
2
4
from matplotlib import pyplot as plt
3
5
4
6
7
+ @cleanup
5
8
def test_contour_shape_1d_valid ():
6
9
7
10
x = np .arange (10 )
@@ -13,6 +16,7 @@ def test_contour_shape_1d_valid():
13
16
ax .contour (x , y , z )
14
17
15
18
19
+ @cleanup
16
20
def test_contour_shape_2d_valid ():
17
21
18
22
x = np .arange (10 )
@@ -25,6 +29,7 @@ def test_contour_shape_2d_valid():
25
29
ax .contour (xg , yg , z )
26
30
27
31
32
+ @cleanup
28
33
def test_contour_shape_mismatch_1 ():
29
34
30
35
x = np .arange (9 )
@@ -40,6 +45,7 @@ def test_contour_shape_mismatch_1():
40
45
assert exc .args [0 ] == 'Length of x must be number of columns in z.'
41
46
42
47
48
+ @cleanup
43
49
def test_contour_shape_mismatch_2 ():
44
50
45
51
x = np .arange (10 )
@@ -55,6 +61,7 @@ def test_contour_shape_mismatch_2():
55
61
assert exc .args [0 ] == 'Length of y must be number of rows in z.'
56
62
57
63
64
+ @cleanup
58
65
def test_contour_shape_mismatch_3 ():
59
66
60
67
x = np .arange (10 )
@@ -76,6 +83,7 @@ def test_contour_shape_mismatch_3():
76
83
assert exc .args [0 ] == 'Number of dimensions of x and y should match.'
77
84
78
85
86
+ @cleanup
79
87
def test_contour_shape_mismatch_4 ():
80
88
81
89
g = np .random .random ((9 , 10 ))
@@ -97,6 +105,7 @@ def test_contour_shape_mismatch_4():
97
105
assert exc .args [0 ] == 'Shape of y does not match that of z: found (9, 9) instead of (9, 10).'
98
106
99
107
108
+ @cleanup
100
109
def test_contour_shape_invalid_1 ():
101
110
102
111
x = np .random .random ((3 , 3 , 3 ))
@@ -112,6 +121,7 @@ def test_contour_shape_invalid_1():
112
121
assert exc .args [0 ] == 'Inputs x and y must be 1D or 2D.'
113
122
114
123
124
+ @cleanup
115
125
def test_contour_shape_invalid_2 ():
116
126
117
127
x = np .random .random ((3 , 3 , 3 ))
0 commit comments