@@ -1434,14 +1434,21 @@ def test_basic(self):
14341434
14351435class TestStrMethodFormatter :
14361436 test_data = [
1437- ('{x:05d}' , (2 ,), '00002' ),
1438- ('{x:03d}-{pos:02d}' , (2 , 1 ), '002-01' ),
1437+ ('{x:05d}' , (2 ,), False , '00002' ),
1438+ ('{x:05d}' , (2 ,), True , '00002' ),
1439+ ('{x:05d}' , (- 2 ,), False , '-0002' ),
1440+ ('{x:05d}' , (- 2 ,), True , '\N{MINUS SIGN} 0002' ),
1441+ ('{x:03d}-{pos:02d}' , (2 , 1 ), False , '002-01' ),
1442+ ('{x:03d}-{pos:02d}' , (2 , 1 ), True , '002-01' ),
1443+ ('{x:03d}-{pos:02d}' , (- 2 , 1 ), False , '-02-01' ),
1444+ ('{x:03d}-{pos:02d}' , (- 2 , 1 ), True , '\N{MINUS SIGN} 02-01' ),
14391445 ]
14401446
1441- @pytest .mark .parametrize ('format, input, expected' , test_data )
1442- def test_basic (self , format , input , expected ):
1443- fmt = mticker .StrMethodFormatter (format )
1444- assert fmt (* input ) == expected
1447+ @pytest .mark .parametrize ('format, input, unicode_minus, expected' , test_data )
1448+ def test_basic (self , format , input , unicode_minus , expected ):
1449+ with mpl .rc_context ({"axes.unicode_minus" : unicode_minus }):
1450+ fmt = mticker .StrMethodFormatter (format )
1451+ assert fmt (* input ) == expected
14451452
14461453
14471454class TestEngFormatter :
0 commit comments