@@ -13,27 +13,43 @@ def test_marker_fillstyle():
1313 assert not marker_style .is_filled ()
1414
1515
16- def test_markers_valid ():
17- marker_style = markers .MarkerStyle ()
18- mrk_array = np .array ([[- 0.5 , 0 ],
19- [0.5 , 0 ]])
16+ @pytest .mark .parametrize ('marker' , [
17+ 'o' ,
18+ 'x' ,
19+ '' ,
20+ 'None' ,
21+ None ,
22+ r'$\frac{1}{2}$' ,
23+ "$\u266B $" ,
24+ 1 ,
25+ markers .TICKLEFT ,
26+ [[- 1 , 0 ], [1 , 0 ]],
27+ np .array ([[- 1 , 0 ], [1 , 0 ]]),
28+ Path ([[0 , 0 ], [1 , 0 ]], [Path .MOVETO , Path .LINETO ]),
29+ (5 , 0 ), # a pentagon
30+ (7 , 1 ), # a 7-pointed star
31+ (5 , 2 ), # asterisk
32+ (5 , 0 , 10 ), # a pentagon, rotated by 10 degrees
33+ (7 , 1 , 10 ), # a 7-pointed star, rotated by 10 degrees
34+ (5 , 2 , 10 ), # asterisk, rotated by 10 degrees
35+ markers .MarkerStyle (),
36+ markers .MarkerStyle ('o' ),
37+ ])
38+ def test_markers_valid (marker ):
2039 # Checking this doesn't fail.
21- marker_style . set_marker ( mrk_array )
40+ markers . MarkerStyle ( marker )
2241
2342
24- def test_markers_invalid ():
25- marker_style = markers .MarkerStyle ()
26- mrk_array = np .array ([[- 0.5 , 0 , 1 , 2 , 3 ]])
27- # Checking this does fail.
43+ @pytest .mark .parametrize ('marker' , [
44+ 'square' , # arbitrary string
45+ np .array ([[- 0.5 , 0 , 1 , 2 , 3 ]]), # 1D array
46+ (1 ,),
47+ (5 , 3 ), # second parameter of tuple must be 0, 1, or 2
48+ (1 , 2 , 3 , 4 ),
49+ ])
50+ def test_markers_invalid (marker ):
2851 with pytest .raises (ValueError ):
29- marker_style .set_marker (mrk_array )
30-
31-
32- def test_marker_path ():
33- marker_style = markers .MarkerStyle ()
34- path = Path ([[0 , 0 ], [1 , 0 ]], [Path .MOVETO , Path .LINETO ])
35- # Checking this doesn't fail.
36- marker_style .set_marker (path )
52+ markers .MarkerStyle (marker )
3753
3854
3955class UnsnappedMarkerStyle (markers .MarkerStyle ):
0 commit comments