File tree 1 file changed +12
-10
lines changed 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -212,20 +212,22 @@ def psfont(*args, **kwargs):
212
212
213
213
@needs_tex
214
214
def test_unicode_won ():
215
- from pylab import rcParams , plot , ylabel , savefig
216
- rcParams . update ({ 'text.usetex' : True , 'text. latex.unicode': True })
215
+ matplotlib . rcParams [ 'text.usetex' ] = True
216
+ matplotlib . rcParams [ 'text.latex.unicode' ] = True
217
217
218
- plot (1 , 1 )
219
- ylabel (r'\textwon' )
218
+ plt .figure ()
219
+ plt .plot (1 , 1 )
220
+ plt .ylabel (r'\textwon' )
220
221
221
222
fd = BytesIO ()
222
- savefig (fd , format = 'svg' )
223
+ plt . savefig (fd , format = 'svg' )
223
224
fd .seek (0 )
224
225
buf = fd .read ().decode ()
225
226
fd .close ()
226
227
227
- won_id = 'Computer_Modern_Sans_Serif-142'
228
- def_regex = re .compile (r'<path d=(.|\s)*?id="{0}"/>' .format (won_id ))
229
- use_regex = re .compile (r'<use[^/>]*? xlink:href="#{0}"/>' .format (won_id ))
230
- assertTrue (bool (def_regex .search (buf )))
231
- assertTrue (bool (use_regex .search (buf )))
228
+ won_id = 'Computer_Modern_Roman-142'
229
+ expected_def = 'id="{0}"' .format (won_id )
230
+ expected_ref = 'xlink:href="#{0}"' .format (won_id )
231
+ print (buf )
232
+ assert expected_def in buf
233
+ assert expected_ref in buf
You can’t perform that action at this time.
0 commit comments