1
1
import io
2
+ import re
2
3
from types import SimpleNamespace
3
4
4
5
import numpy as np
@@ -706,17 +707,17 @@ def test_quadmesh_set_array_validation():
706
707
coll = ax .pcolormesh (x , y , np .ones (z .shape ))
707
708
z = np .arange (16 ).reshape ((4 , 4 ))
708
709
709
- with pytest .raises (TypeError , match = "Dimensions of A (4, 4) "
710
- "are incompatible with X (3) and/or Y (3)" ):
710
+ with pytest .raises (TypeError , match = re . escape ( "Dimensions of A (4, 4) "
711
+ "are incompatible with X (3) and/or Y (3)" )) :
711
712
coll .set_array (z )
712
- with pytest .raises (TypeError , match = "Dimensions of A (16,) "
713
- "are incompatible with X (3) and/or Y (3)" ):
713
+ with pytest .raises (TypeError , match = re . escape ( "Dimensions of A (16,) "
714
+ "are incompatible with X (3) and/or Y (3)" )) :
714
715
coll .set_array (z .ravel ())
715
716
716
717
fig , ax = plt .subplots ()
717
718
coll = ax .pcolormesh (x , y , np .ones (z .shape ), shading = 'nearest' )
718
- with pytest .raises (TypeError , match = "Dimensions of A (3, 3) "
719
- "are incompatible with X (4) and/or Y (4)" ):
719
+ with pytest .raises (TypeError , match = re . escape ( "Dimensions of A (3, 3) "
720
+ "are incompatible with X (4) and/or Y (4)" )) :
720
721
z = np .arange (9 ).reshape ((3 , 3 ))
721
722
coll .set_array (z )
722
723
@@ -726,8 +727,8 @@ def test_quadmesh_set_array_validation():
726
727
fig , ax = plt .subplots ()
727
728
coll = ax .pcolormesh (x , y , np .ones (z .shape ), shading = 'gouraud' )
728
729
z = np .arange (16 ).reshape ((4 , 4 ))
729
- with pytest .raises (TypeError , match = "Dimensions of A (4, 4) "
730
- "are incompatible with X (2) and/or Y (2)" ):
730
+ with pytest .raises (TypeError , match = re . escape ( "Dimensions of A (4, 4) "
731
+ "are incompatible with X (2) and/or Y (2)" )) :
731
732
coll .set_array (z )
732
733
733
734
0 commit comments