-
-
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
Conversation
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to get rid of this too, replace the list(xrange(#))
by np.arange(#)
; I don't think there's anything here that explicitly requires a list.
@@ -1,5 +1,5 @@ | |||
import matplotlib.gridspec as gridspec | |||
from nose.tools import assert_raises, assert_equal | |||
from numpy.testing import assert_raises, assert_equal |
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 the pytest.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
@@ -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) |
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.
assert_array_equal
is used in a few of the tests.
Current coverage is 62.18% (diff: 100%)@@ master #7898 diff @@
==========================================
Files 174 175 +1
Lines 56121 56125 +4
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 34896 34901 +5
+ Misses 21225 21224 -1
Partials 0 0
|
ax.plot(np.linspace(4, 4.1), 'o', label='D\xe9velopp\xe9s') | ||
ax.plot(list(xrange(4, 1, -1)), 'o', label='__nolegend__') | ||
ax.plot(np.arage(4, 1, -1), 'o', label='__nolegend__') |
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.
np.arange
in this one and the one above.
From |
thanks for all of the merges, @jkseppan ! |
This continues the migration from pytest to nose.