[SciPy-Dev] GSoC'17 candidate - Interested in Nose to Pytest Migration.

Charles R Harris charlesr.harris at gmail.com
Mon Feb 27 11:44:29 EST 2017


On Mon, Feb 27, 2017 at 9:13 AM, Evgeni Burovski <evgeny.burovskiy at gmail.com
> wrote:

> Hi Karan,
>
> Glad to see interest in this project!
>
> Your credentials look great. We'll need a small patch to numpy or scipy,
> too.
>
> A few scattered thoughts about the project:
>
> - This is not exactly a transition to pytest as such. The goal is to allow
> an alternative test runner, with minimal changes to the test suite.
> - At the moment, nose is an optional dependency of numpy and scipy. This
> should be the same with pytest: both numpy and scipy should remain
> importable without either nose or pytest.
> - All tests should be run with either test runner (this will need to be
> checked early on).
> - We should try to decouple the test runner as much as reasonable.
> pytest-specific things should be kept to a minimum. E.g. rewriting of
> assertions should be left out, I think.
>
> A few possibly sticky points:
>
> * both test suites are organized per submodule. This does not seem to mesh
> well with pytest's idea of collecting things in a conftest.py file: we
> either need to duplicate conftest.py files in each submodule/tests/ folder
> or there hopefully is some better magic. At least I did not manage to in a
> quick look I took a while ago, https://github.com/ev-br/
> numpy/commits/pytest
>
> * yield-based test generators. pytest says they are deprecated and are
> going to be removed in pytest 4. I don't know what is the status of pytest
> 4 --- is it something with a defined release date or just some uncertain
> future horizon or something in between. I guess we'll need to ask pytest
> devs. Meanwhile, there is a switch to silence the deprecation warnings in
> pytest 3.
>
> * The solution should work for both numpy and scipy. It seems reasonable
> to hide the nose/pytest specific stuff in the numpy.testing module. However
> scipy (and other downstream packages) have to support older versions of
> numpy, so anything new in numpy 1.13 is not going to be immediately useful
> downstream.
>
> It would also be good to hear from numpy devs (which I am not, so take
> what I'm saying about numpy with a spoonful of salt :-))
>

I think we need to redo the generator based tests to not use generators. If
we confine numpy/scipy testing to pytest we may look at parametrized tests
as a replacement.  Supporting both pytest and nose for downstream projects
may be tricky. Note that the downstream projects already using pytest don't
need us, so the number requiring the numpy testing apparatus may be limited.

I don't know much about pytest, so suggestions from more knowledgeable
folks is welcome.

<snip>

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20170227/abfd3d0e/attachment.html>


More information about the SciPy-Dev mailing list