Skip to content

Commit c4a19c1

Browse files
committed
Make sure convert works without nose.
1 parent d379ef6 commit c4a19c1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/testing/compare.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,14 @@ def convert(filename, cache):
174174
"""
175175
base, extension = filename.rsplit('.', 1)
176176
if extension not in converter:
177-
from nose import SkipTest
178-
raise SkipTest("Don't know how to convert %s files to png" % extension)
177+
reason = "Don't know how to convert %s files to png" % extension
178+
from . import is_called_from_pytest
179+
if is_called_from_pytest():
180+
import pytest
181+
pytest.skip(reason)
182+
else:
183+
from nose import SkipTest
184+
raise SkipTest(reason)
179185
newname = base + '_' + extension + '.png'
180186
if not os.path.exists(filename):
181187
raise IOError("'%s' does not exist" % filename)

0 commit comments

Comments
 (0)