@@ -341,34 +341,24 @@ def test_minus_signs_with_tex(fig_test, fig_ref, texsystem):
341341
342342@pytest .mark .backend ("pgf" )
343343def test_sketch_params ():
344- fig , ax = plt .subplots (figsize = [ 3 , 3 ] )
344+ fig , ax = plt .subplots (figsize = ( 3 , 3 ) )
345345 ax .set_xticks ([])
346346 ax .set_yticks ([])
347347 ax .set_frame_on (False )
348- handle = ax .plot ([0 , 1 ])[ 0 ]
348+ handle , = ax .plot ([0 , 1 ])
349349 handle .set_sketch_params (scale = 5 , length = 30 , randomness = 42 )
350350
351351 with BytesIO () as fd :
352352 fig .savefig (fd , format = 'pgf' )
353353 buf = fd .getvalue ().decode ()
354354
355- baseline = r"""\begin{pgfscope}%
356- \pgfpathrectangle{\pgfqpoint{0.375000in}{0.300000in}}""" \
357- r"""{\pgfqpoint{2.325000in}{2.400000in}}%
358- \pgfusepath{clip}%
359- \pgfsetrectcap%
360- \pgfsetroundjoin%
361- \pgfsetlinewidth{1.003750pt}%
362- \definecolor{currentstroke}{rgb}{0.000000,0.000000,1.000000}%
363- \pgfsetstrokecolor{currentstroke}%
364- \pgfsetdash{}{0pt}%
365- \pgfpathmoveto{\pgfqpoint{0.375000in}{0.300000in}}%
355+ baseline = r"""\pgfpathmoveto{\pgfqpoint{0.375000in}{0.300000in}}%
366356\pgfpathlineto{\pgfqpoint{2.700000in}{2.700000in}}%
367357\pgfkeys{/pgf/decoration/.cd, """ \
368358 r"""segment length = 0.300000in, amplitude = 0.050000in}%
369359\pgfmathsetseed{42}%
370360\pgfdecoratecurrentpath{random steps}%
371- \pgfusepath{stroke}%
372- \end{pgfscope}%"""
373- # check that \pgfkeys{/pgf/decoration/.cd, ...} is in path definition
361+ \pgfusepath{stroke}%"""
362+ # \pgfdecoratecurrentpath must be after the path definition and before the
363+ # path is used (\pgfusepath)
374364 assert baseline in buf
0 commit comments