@@ -73,32 +73,34 @@ def func():
7373
7474
7575def test_RcParams_class ():
76- rc = mpl .RcParams ({'font.cursive' : ['Apple Chancery' ,
77- 'Textile' ,
78- 'Zapf Chancery' ,
79- 'cursive' ],
76+ rc = mpl .RcParams ({'font.cursive' : ['Zapf Chancery' , 'cursive' ],
8077 'font.family' : 'sans-serif' ,
8178 'font.weight' : 'normal' ,
8279 'font.size' : 12 })
8380
8481 expected_repr = """
85- RcParams({'font.cursive': ['Apple Chancery',
86- 'Textile',
87- 'Zapf Chancery',
88- 'cursive'],
82+ RcParams({
83+ 'font.cursive': ['Zapf Chancery', 'cursive'],
8984 'font.family': ['sans-serif'],
9085 'font.size': 12.0,
91- 'font.weight': 'normal'})""" .lstrip ()
86+ 'font.weight': 'normal',
87+ })""" .lstrip ()
9288
93- assert expected_repr == repr (rc )
89+ actual_repr = repr (rc )
90+ if sys .version_info [:2 ] < (3 , 15 ):
91+ actual_repr = (actual_repr
92+ .replace ("{'" , "{\n '" )
93+ .replace ("'}" , "',\n }" ))
94+
95+ assert actual_repr == expected_repr
9496
9597 expected_str = """
96- font.cursive: ['Apple Chancery', 'Textile', ' Zapf Chancery', 'cursive']
98+ font.cursive: ['Zapf Chancery', 'cursive']
9799font.family: ['sans-serif']
98100font.size: 12.0
99101font.weight: normal""" .lstrip ()
100102
101- assert expected_str == str (rc )
103+ assert str (rc ) == expected_str
102104
103105 # test the find_all functionality
104106 assert ['font.cursive' , 'font.size' ] == sorted (rc .find_all ('i[vz]' ))
0 commit comments