11import numpy as np
2+
3+ from matplotlib .testing .decorators import cleanup
24from matplotlib import pyplot as plt
35
46
7+ @cleanup
58def 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
1620def 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
2833def 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
4349def 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
5865def 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
7987def 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
100109def 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
115125def test_contour_shape_invalid_2 ():
116126
117127 x = np .random .random ((3 , 3 , 3 ))
0 commit comments