10000 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

MAINT moved g-i-l* modules to pytest #7898

merged 8 commits into from
Jan 23, 2017

Conversation

NelleV
Copy link
Member
@NelleV NelleV commented Jan 20, 2017

This continues the migration from pytest to nose.

@NelleV
Copy link
Member Author
NelleV commented Jan 20, 2017

@QuLogic @Kojoley What do you do with from nose.plugins.attrib import attr?

@NelleV NelleV changed the title MAINT moved g-i-l* modules to pytest [WIP] MAINT moved g-i-l* modules to pytest Jan 20, 2017
10000
@@ -1,14 +1,13 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import six
from six.moves import xrange
Copy link
Member

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.

@QuLogic
Copy link
Member
QuLogic commented Jan 20, 2017

@QuLogic @Kojoley What do you do with from nose.plugins.attrib import attr?

There's a plugin that tries to emulate the same test selection mechanism, but for basic equivalence, use @pytest.mark.network instead of @attr('network').

@@ -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

@@ -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)
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.

@NelleV NelleV changed the title [WIP] MAINT moved g-i-l* modules to pytest [MRG] MAINT moved g-i-l* modules to pytest Jan 22, 2017
@codecov-io
Copy link
codecov-io commented Jan 23, 2017

Current coverage is 62.18% (diff: 100%)

Merging #7898 into master will increase coverage by <.01%

@@             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          

Powered by Codecov. Last update 194afed...32c3317

@QuLogic QuLogic changed the title [MRG] MAINT moved g-i-l* modules to pytest [MRG+1] MAINT moved g-i-l* modules to pytest Jan 23, 2017
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__')
Copy link
Member

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.

@soupault
Copy link
Contributor

This continues the migration from pytest to nose.

From nose to pytest you mean? :)

@jkseppan jkseppan changed the title [MRG+1] MAINT moved g-i-l* modules to pytest MAINT moved g-i-l* modules to pytest Jan 23, 2017
@jkseppan jkseppan merged commit 7f476f5 into matplotlib:master Jan 23, 2017
@phobson
Copy link
Member
phobson commented Jan 23, 2017

thanks for all of the merges, @jkseppan !

@NelleV NelleV deleted the pytest_gil_modules branch January 29, 2017 18:42
@QuLogic QuLogic added this to the v2.1 milestone Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0