@@ -631,36 +631,24 @@ def test_rcparams_legend_loc_from_file(tmpdir, value):
631
631
assert mpl .rcParams ["legend.loc" ] == value
632
632
633
633
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)' ])
635
635
def test_validate_sketch (value ):
636
636
mpl .rcParams ["path.sketch" ] = value
637
637
assert mpl .rcParams ["path.sketch" ] == (1 , 2 , 3 )
638
638
assert validate_sketch (value ) == (1 , 2 , 3 )
639
639
640
640
641
- @pytest .mark .parametrize ("value" , [1 , '1' , '(1, 2, 3) ' ])
641
+ @pytest .mark .parametrize ("value" , [1 , '1' , '1 2 3 ' ])
642
642
def test_validate_sketch_error (value ):
643
- with pytest .raises (ValueError , match = "' scale, length, randomness' " ):
643
+ with pytest .raises (ValueError , match = "scale, length, randomness" ):
644
644
validate_sketch (value )
645
- with pytest .raises (ValueError , match = "' scale, length, randomness' " ):
645
+ with pytest .raises (ValueError , match = "scale, length, randomness" ):
646
646
mpl .rcParams ["path.sketch" ] = value
647
647
648
648
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 ):
650
651
rc_path = tmpdir .join ("matplotlibrc" )
651
- rc_path .write ("path.sketch: 1, 2, 3" )
652
-
652
+ rc_path .write (f"path.sketch: { value } " )
653
653
with mpl .rc_context (fname = rc_path ):
654
654
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