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 0cd9194

Browse filesBrowse files
committed
Make test suite fail on warnings.
1 parent 4236b57 commit 0cd9194
Copy full SHA for 0cd9194

File tree

Expand file treeCollapse file tree

3 files changed

+6
-4
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+6
-4
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6073,7 +6073,8 @@ def invert(x):
60736073

60746074
secax(0.2, functions=(invert, invert))
60756075
secax(0.4, functions=(lambda x: 2 * x, lambda x: x / 2))
6076-
secax(0.6, functions=(lambda x: x**2, lambda x: x**(1/2)))
6076+
with pytest.warns(RuntimeWarning): # Needs to be fixed.
6077+
secax(0.6, functions=(lambda x: x**2, lambda x: x**(1/2)))
60776078
secax(0.8)
60786079

60796080

‎lib/matplotlib/tests/test_cbook.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_cbook.py
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,8 @@ def test_normalize_kwargs_pass(inp, expected, kwargs_to_norm):
353353
def test_warn_external_frame_embedded_python():
354354
with patch.object(cbook, "sys") as mock_sys:
355355
mock_sys._getframe = Mock(return_value=None)
356-
with warnings.catch_warnings(record=True) as w:
356+
with pytest.warns(UserWarning, match=r"\Adummy\Z"):
357357
cbook._warn_external("dummy")
358-
assert len(w) == 1
359-
assert str(w[0].message) == "dummy"
360358

361359

362360
def test_to_prestep():

‎pytest.ini

Copy file name to clipboardExpand all lines: pytest.ini
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ python_files = test_*.py
77
markers =
88
backend: Set alternate Matplotlib backend temporarily.
99
style: Set alternate Matplotlib style temporarily.
10+
11+
filterwarnings =
12+
error

0 commit comments

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