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

Skip to content

Commit 2f0dca9

Browse files
committed
Skip font test if font is already available.
1 parent 4b5a2db commit 2f0dca9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/tests/test_font_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ def test_user_fonts_linux(tmpdir, monkeypatch):
137137

138138
# Precondition: the test font should not be available
139139
fonts = findSystemFonts()
140-
assert not any(font_test_file in font for font in fonts)
140+
if any(font_test_file in font for font in fonts):
141+
pytest.skip(f'{font_test_file} already exists in system fonts')
141142

142143
# Prepare a temporary user font directory
143144
user_fonts_dir = tmpdir.join('fonts')
@@ -167,7 +168,8 @@ def test_user_fonts_win32():
167168

168169
# Precondition: the test font should not be available
169170
fonts = findSystemFonts()
170-
assert not any(font_test_file in font for font in fonts)
171+
if any(font_test_file in font for font in fonts):
172+
pytest.skip(f'{font_test_file} already exists in system fonts')
171173

172174
user_fonts_dir = MSUserFontDirectories[0]
173175

0 commit comments

Comments
 (0)