Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3c1d28c

Browse files
authored
Merge pull request #19273 from timhoffm/test-xfail
Use proper pytest functionality for warnings and exceptions
2 parents 4e4410d + 8c48b70 commit 3c1d28c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/matplotlib/tests/test_mathtext.py

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