8000 MAINT moved g-i-l* modules to pytest by NelleV · Pull Request #7898 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 8 commits into from
Jan 23, 2017
Merged
Show file tree
Hide file tree
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
Next Next commit
MAINT moved test_image to pytest
  • Loading branch information
NelleV committed Jan 20, 2017
commit 9903f84234085008a032a53d1db0a90270b9a39a
1 change: 0 additions & 1 deletion lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,6 @@ def _jupyter_nbextension_paths():
'matplotlib.tests.test_figure',
'matplotlib.tests.test_font_manager',
'matplotlib.tests.test_gridspec',
'matplotlib.tests.test_image',
'matplotlib.tests.test_legend',
'matplotlib.tests.test_lines',
'matplotlib.tests.test_mathtext',
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_gridspec.py
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

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?

Copy link
Member Author

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



def test_equal():
Expand Down
12 changes: 1 addition & 11 deletions lib/matplotlib/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

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.

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
Expand Down Expand Up @@ -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)
0