FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix: Gracefully fail the string validator for tuple inputs by iofall · Pull Request #24600 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion lib/matplotlib/rcsetup.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __call__(self, s):
name, = (k for k, v in globals().items() if v is self)
_api.warn_deprecated(
self._deprecated_since, name=name, obj_type="function")
if self.ignorecase:
if self.ignorecase and isinstance(s, str):
s = s.lower()
if s in self.valid:
return self.valid[s]
Expand Down
8 changes: 8 additions & 0 deletions lib/matplotlib/tests/test_rcparams.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import copy
import os
from pathlib import Path
import re
import subprocess
import sys
from unittest import mock
Expand Down Expand Up @@ -591,3 +592,10 @@ def test_deprecation(monkeypatch):
# Note that the warning suppression actually arises from the
# iteration over the updater rcParams being protected by
# suppress_matplotlib_deprecation_warning, rather than any explicit check.


def test_rcparams_legend_loc():
value = (0.9, .7)
match_str = f"{value} is not a valid value for legend.loc;"
with pytest.raises(ValueError, match=re.escape(match_str)):
mpl.RcParams({'legend.loc': value})

Back | FazBrowse Home | New Git URL