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 f7640d9

Browse filesBrowse files
Replace assert with match argument in the pytest.warns call
1 parent f8ba9d3 commit f7640d9
Copy full SHA for f7640d9

File tree

Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed

‎lib/matplotlib/tests/test_backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backend_bases.py
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ def test_toolbar_zoompan():
165165
plt.rcParams['toolbar'] = 'toolmanager'
166166
ax = plt.gca()
167167
assert ax.get_navigate_mode() is None
168-
with pytest.warns(UserWarning) as rec:
168+
expected_warning_regex = (r"The new Tool classes introduced in "
169+
r"v[0-9]*.[0-9]* are experimental")
170+
with pytest.warns(UserWarning, match=expected_warning_regex) as rec:
169171
ax.figure.canvas.manager.toolmanager.add_tool(name="zoom",
170172
tool=ToolZoom)
171173
ax.figure.canvas.manager.toolmanager.add_tool(name="pan",
@@ -178,7 +180,3 @@ def test_toolbar_zoompan():
178180
assert ax.get_navigate_mode() == "ZOOM"
179181
ax.figure.canvas.manager.toolmanager.trigger_tool('pan')
180182
assert ax.get_navigate_mode() == "PAN"
181-
assert(len(rec) == 4)
182-
for r in rec:
183-
assert("The new Tool classes introduced in v1.5 are experimental"
184-
in str(r.message))

0 commit comments

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