-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MAINT moved g-i-l* modules to pytest #7898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
9903f84
c6264ca
178d6a1
88a5212
ff71b36
a310cba
92ac268
32c3317
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,17 +20,11 @@ | |
import matplotlib.pyplot as plt | ||
|
||
from matplotlib import mlab | ||
from nose.tools import assert_raises | ||
from numpy.testing import ( | ||
assert_array_equal, assert_array_almost_equal, assert_allclose) | ||
|
||
from copy import copy | ||
from numpy import ma | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
import matplotlib.colors as colors | ||
import matplotlib.pyplot as plt | ||
import matplotlib.mlab as mlab | ||
import numpy as np | ||
|
||
import nose | ||
|
||
try: | ||
from PIL import Image | ||
|
@@ -753,7 +747,3 @@ def test_imshow_no_warn_invalid(): | |
warnings.simplefilter("always") | ||
plt.imshow([[1, 2], [3, np.nan]]) | ||
assert len(warns) == 0 | ||
|
||
|
||
if __name__ == '__main__': | ||
nose.runmodule(argv=['-s', '--with-doctest'], exit=False) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
from __future__ import (absolute_import, division, print_function, | ||
unicode_literals) | ||
|
||
import six | ||
from six.moves import xrange | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want to get rid of this too, replace the |
||
try: | ||
# mock in python 3.3+ | ||
from unittest import mock | ||
except ImportError: | ||
import mock | ||
from nose.tools import assert_equal | ||
from numpy.testing import assert_equal | ||
import numpy as np | ||
|
||
from matplotlib.testing.decorators import image_comparison, cleanup | ||
|
@@ -143,14 +142,14 @@ def test_framealpha(): | |
remove_text=True) | ||
def test_rc(): | ||
# using subplot triggers some offsetbox functionality untested elsewhere | ||
fig = plt.figure() | ||
plt.figure() | ||
ax = plt.subplot(121) | ||
ax.scatter(list(xrange(10)), list(xrange(10, 0, -1)), label='three') | ||
ax.legend(loc="center left", bbox_to_anchor=[1.0, 0.5], | ||
title="My legend") | ||
|
||
mpl.rcParams['legend.scatterpoints'] = 1 | ||
fig = plt.figure() | ||
plt.figure() | ||
ax = plt.subplot(121) | ||
ax.scatter(list(xrange(10)), list(xrange(10, 0, -1)), label='one') | ||
ax.legend(loc="center left", bbox_to_anchor=[1.0, 0.5], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I've been testing it out without nose installed and
numpy.testing.assert_raises
doesn't work with nose installed. Can you replace it with thepytest.raises
context manager?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep.
FYI, if you look at skimage's pytest transition PR, you'll have a good idea of what will work and what won't.
scikit-image/scikit-image#2468