Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 19298c9

Browse filesBrowse files
committed
Add test for annotation parameter name change warning
Flake8 Match warning to ensure correct one caught, Update version deprecated Flake8 whitespace Simplify test
1 parent e39e3cf commit 19298c9
Copy full SHA for 19298c9

File tree

Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ def text(self, x, y, s, fontdict=None, **kwargs):
753753
self._add_text(t)
754754
return t
755755

756-
@cbook._rename_parameter("3.2", "s", "text")
756+
@cbook._rename_parameter("3.3", "s", "text")
757757
@docstring.dedent_interpd
758758
def annotate(self, text, xy, *args, **kwargs):
759759
a = mtext.Annotation(text, xy, *args, **kwargs)

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,14 @@ def test_basic_annotate():
435435
xytext=(3, 3), textcoords='offset points')
436436

437437

438+
def test_annotate_parameter_warn():
439+
fig, ax = plt.subplots()
440+
with pytest.warns(MatplotlibDeprecationWarning,
441+
match=r"The \'s\' parameter of annotate\(\) "
442+
"has been renamed \'text\'"):
443+
ax.annotate(s='now named text', xy=(0, 1))
444+
445+
438446
@image_comparison(['arrow_simple.png'], remove_text=True)
439447
def test_arrow_simple():
440448
# Simple image test for ax.arrow

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.