Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make sure convert works without nose.
  • Loading branch information
QuLogic committed Jan 27, 2017
commit c4a19c12ebb95fcccc9cd3f2aba14ef3584ddc06
10 changes: 8 additions & 2 deletions lib/matplotlib/testing/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,14 @@ def convert(filename, cache):
"""
base, extension = filename.rsplit('.', 1)
if extension not in converter:
from nose import SkipTest
raise SkipTest("Don't know how to convert %s files to png" % extension)
reason = "Don't know how to convert %s files to png" % extension
from . import is_called_from_pytest
if is_called_from_pytest():
import pytest
pytest.skip(reason)
else:
from nose import SkipTest
raise SkipTest(reason)
newname = base + '_' + extension + '.png'
if not os.path.exists(filename):
raise IOError("'%s' does not exist" % filename)
Expand Down