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 8c48b70

Browse filesBrowse files
committed
Use proper pytest functionality for warnings and exceptions
... and let the test pass, instead of letting the test blow up and marking them as xfail.
1 parent 4e4410d commit 8c48b70
Copy full SHA for 8c48b70

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+4
-4
lines changed

‎lib/matplotlib/tests/test_mathtext.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_mathtext.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,16 +310,16 @@ def test_mathtext_fallback_valid():
310310
mpl.rcParams['mathtext.fallback'] = fallback
311311

312312

313-
@pytest.mark.xfail
314313
def test_mathtext_fallback_invalid():
315314
for fallback in ['abc', '']:
316-
mpl.rcParams['mathtext.fallback'] = fallback
315+
with pytest.raises(ValueError, match="not a valid fallback font name"):
316+
mpl.rcParams['mathtext.fallback'] = fallback
317317

318318

319-
@pytest.mark.xfail
320319
def test_mathtext_fallback_to_cm_invalid():
321320
for fallback in [True, False]:
322-
mpl.rcParams['mathtext.fallback_to_cm'] = fallback
321+
with pytest.warns(_api.MatplotlibDeprecationWarning):
322+
mpl.rcParams['mathtext.fallback_to_cm'] = fallback
323323

324324

325325
@pytest.mark.parametrize(

0 commit comments

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