Parameterized tests in pytest are _way_ better than the yield based tests. I use pytest fixtures pretty heavily at my day job and am super happy. mpl's test suite on master currently runs under both as of https://github.com/matplotlib/matplotlib/pull/6730 (we now have some pytest only tests as well) and are probably a few days of effort away from switching entirely (our tests.py script still runs the nose version). The big advantage of supporting both (at least for a while) is that you can get both to run and report they ran the same number of tests to be sure you did not make any mistakes. The test suite protects you when you refactor the code, what protects you when you refactor the tests >:) Tom On Sun, Jan 1, 2017 at 7:36 PM Juan Nunez-Iglesias <jni.soma@gmail.com> wrote:
+1 for pytest.
Nelle, can you comment a bit on why scikit-learn effectively decided to roll their own test library? ;) Is it part of their general (and well-justified) aversion to new dependencies, or were there specific objections to pytest?
Pytest mostly works out of the box with tests written for nose. As far as I know the exceptions are:
- all the nose imports that Stéfan pointed out (btw how did an import * make its way into our codebase???) - it seems that yielding tests is deprecated, so that will require a few rewrites.
It's not a trivial effort to fix these, but I don't think it'll be any bigger than any other move.
Juan.
On 1 Jan 2017, 10:26 AM +1100, Stefan van der Walt <stefanv@berkeley.edu>, wrote:
On Sat, Dec 31, 2016, at 15:05, Steven Silvester wrote:
I agree with Stéfan that a forward-looking clean break would be best. It looks like a rather large undertaking though, judging from https://github.com/matplotlib/matplotlib/pull/5405.
Perhaps we are better off than matplotlib:
$ git grep "from nose" skimage/_shared/testing.py: from nose.tools import assert_less skimage/_shared/testing.py: from nose.tools import assert_greater skimage/_shared/tests/test_testing.py:from nose.tools import (assert_true, assert_raises, assert_equal) skimage/draw/tests/test_draw3d.py:from nose.tools import raises skimage/io/tests/test_sift.py:from nose.tools import * skimage/novice/tests/test_novice.py:from nose.tools import assert_true skimage/segmentation/tests/test_quickshift.py:from nose.tools import assert_true skimage/util/tests/test_montage.py:from nose.tools import assert_equal, raises skimage/util/tests/test_shape.py:from nose.tools import raises
Stéfan
_______________________________________________ scikit-image mailing list scikit-image@python.org https://mail.python.org/mailman/listinfo/scikit-image
_______________________________________________ scikit-image mailing list scikit-image@python.org https://mail.python.org/mailman/listinfo/scikit-image