| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,7 +68,7 @@ def __call__(self, s): | |||
| 68 | 68 | name, = (k for k, v in globals().items() if v is self) | |
| 69 | 69 | _api.warn_deprecated( | |
| 70 | 70 | self._deprecated_since, name=name, obj_type="function") | |
| 71 | - if self.ignorecase: | ||
| 71 | + if self.ignorecase and isinstance(s, str): | ||
| 72 | 72 | s = s.lower() | |
| 73 | 73 | if s in self.valid: | |
| 74 | 74 | return self.valid[s] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,7 @@ | |||
| 1 | 1 | import copy | |
| 2 | 2 | import os | |
| 3 | 3 | from pathlib import Path | |
| 4 | + import re | ||
| 4 | 5 | import subprocess | |
| 5 | 6 | import sys | |
| 6 | 7 | from unittest import mock | |
@@ -591,3 +592,10 @@ def test_deprecation(monkeypatch): | |||
| 591 | 592 | # Note that the warning suppression actually arises from the | |
| 592 | 593 | # iteration over the updater rcParams being protected by | |
| 593 | 594 | # 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}) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments