Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit0cd9194

Browse files
committed
Make test suite fail on warnings.
1 parent4236b57 commit0cd9194

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

‎lib/matplotlib/tests/test_axes.py‎

Lines 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=(lambdax:2*x,lambdax:x/2))
6076-
secax(0.6,functions=(lambdax:x**2,lambdax:x**(1/2)))
6076+
withpytest.warns(RuntimeWarning):# Needs to be fixed.
6077+
secax(0.6,functions=(lambdax:x**2,lambdax:x**(1/2)))
60776078
secax(0.8)
60786079

60796080

‎lib/matplotlib/tests/test_cbook.py‎

Lines 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
deftest_warn_external_frame_embedded_python():
354354
withpatch.object(cbook,"sys")asmock_sys:
355355
mock_sys._getframe=Mock(return_value=None)
356-
withwarnings.catch_warnings(record=True)asw:
356+
withpytest.warns(UserWarning,match=r"\Adummy\Z"):
357357
cbook._warn_external("dummy")
358-
assertlen(w)==1
359-
assertstr(w[0].message)=="dummy"
360358

361359

362360
deftest_to_prestep():

‎pytest.ini‎

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp