File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def __call__(self, s):
6868 name , = (k for k , v in globals ().items () if v is self )
6969 _api .warn_deprecated (
7070 self ._deprecated_since , name = name , obj_type = "function" )
71- if self .ignorecase :
71+ if self .ignorecase and isinstance ( s , str ) :
7272 s = s .lower ()
7373 if s in self .valid :
7474 return self .valid [s ]
Original file line number Diff line number Diff line change 11import copy
22import os
33from pathlib import Path
4+ import re
45import subprocess
56import sys
67from unittest import mock
@@ -591,3 +592,10 @@ def test_deprecation(monkeypatch):
591592 # Note that the warning suppression actually arises from the
592593 # iteration over the updater rcParams being protected by
593594 # suppress_matplotlib_deprecation_warning, rather than any explicit check.
595+
596+
597+ def test_rcparams_legend_loc ():
598+ value = (0.9 , .7 )
599+ match_str = f"{ value } is not a valid value for legend.loc;"
600+ with pytest .raises (ValueError , match = re .escape (match_str )):
601+ mpl .RcParams ({'legend.loc' : value })
You can’t perform that action at this time.
0 commit comments