@@ -631,36 +631,24 @@ def test_rcparams_legend_loc_from_file(tmpdir, value):
631631 assert mpl .rcParams ["legend.loc" ] == value
632632
633633
634- @pytest .mark .parametrize ("value" , [(1 , 2 , 3 ), '1, 2, 3' ])
634+ @pytest .mark .parametrize ("value" , [(1 , 2 , 3 ), '1, 2, 3' , '(1, 2, 3)' ])
635635def test_validate_sketch (value ):
636636 mpl .rcParams ["path.sketch" ] = value
637637 assert mpl .rcParams ["path.sketch" ] == (1 , 2 , 3 )
638638 assert validate_sketch (value ) == (1 , 2 , 3 )
639639
640640
641- @pytest .mark .parametrize ("value" , [1 , '1' , '(1, 2, 3) ' ])
641+ @pytest .mark .parametrize ("value" , [1 , '1' , '1 2 3 ' ])
642642def test_validate_sketch_error (value ):
643- with pytest .raises (ValueError , match = "' scale, length, randomness' " ):
643+ with pytest .raises (ValueError , match = "scale, length, randomness" ):
644644 validate_sketch (value )
645- with pytest .raises (ValueError , match = "' scale, length, randomness' " ):
645+ with pytest .raises (ValueError , match = "scale, length, randomness" ):
646646 mpl .rcParams ["path.sketch" ] = value
647647
648648
649- def test_rcparams_path_sketch_from_file (tmpdir ):
649+ @pytest .mark .parametrize ("value" , ['1, 2, 3' , '(1,2,3)' ])
650+ def test_rcparams_path_sketch_from_file (tmpdir , value ):
650651 rc_path = tmpdir .join ("matplotlibrc" )
651- rc_path .write ("path.sketch: 1, 2, 3" )
652-
652+ rc_path .write (f"path.sketch: { value } " )
653653 with mpl .rc_context (fname = rc_path ):
654654 assert mpl .rcParams ["path.sketch" ] == (1 , 2 , 3 )
655-
656-
657- def test_rcparams_path_sketch_from_file_error (tmpdir , caplog ):
658- # rcParams parser doesn't read a tuple rcfile entry
659- rc_path = tmpdir .join ("matplotlibrc" )
660- rc_path .write ("path.sketch: (1, 2, 3)" )
661-
662- with mpl .rc_context (fname = rc_path ):
663- with caplog .at_level ("WARNING" ):
664- assert mpl .rcParams ['path.sketch' ] is None
665- assert ("Expected a 'scale, length, randomness' triplet"
666- in caplog .text )
0 commit comments