Karan Desai
2017-03-12 08:19:39 UTC
Hello developers,
I wrote an introductory thread about two weeks ago, expressing my interest in
this project. The thread grew very huge and it took me a while to aggregate the
suggestions and views of all the fellow developers of the community. Meanwhile,
I also inspected the test suite of scipy. I am putting up my conclusions and
thoughts further.
As an added information, I should specify, as earlier that I have dropped nose
and integrated pytest properly into "joblib". Some of the test suite designs
were positively affirmed by a Pytest core developer on the issue thread. Here
they go:
1. The homepage of Nose after its release of 1.3.7 states that it is no longer
maintained. I see no reason continue supporting it, as now or later we will
have to let it go. Also I am sure many prominent libraries having scipy or
numpy as dependency have already started the shift.
2. If we are using pytest, then we should make full usage of pytest alone. A
small utility library like joblib with a few hunderds of tests cut down
around 700 lines of code by adopting pytest design.
3. While testing utils can be kept independent of pytest, we should fully
embrace pytest for own own unit tests. or even better, we can thinly wrap
pytest and make array assertion possible by plain assert keyword statements
in some way. ( I haven't thought about it yet ).
4. Making the test suites just work with pytest is a matter of one PR, or a
weekend's work and I agree with developers of scikit-image. But it takes
more time to complete redesign tests in flavor of pytest, after all we have
to think about future contributors joining in. People experienced with
pytest should fine the test suite design familiar, for contributions. I
think that scikit-image has achieved the former, but still might need some
PRs for the latter ( I'm glad to help in future ).
5. Here are some notable changes which are required for pytest transition:
6. Plain assert keyword statements.Pytest's own raise and warn assert helpers
produce cleaner error logs on failure.Use pytest's parametrization to get
rid of yield based tests and form compact tests.Fixtures like tmpdir,
capsys, monkeypatch and others provided by pytest help reduce a lot of
boiler plate code.
7. Analyzing the test suite of scipy, I think that it is perfectly fine to
adopt a strategy I used before in Joblib. I will present my first draft
soon, and it will be heavily inspired from this issue thread:
https://www.github.com/joblib/joblib/issues/411 . I made around 20 PRs and
after merge of every PR, the suite was in a working condition, so keeping a
separate branch shall not be required.
I suggest on not falling back to unittests as it will increase the boilerplate
code heavily. The reason of not supporting both nosetests and pytest is because
they have different flavours, and that it would be difficult to keep up with
nose an pytest always comes with something interesting every two months in new
releases.
I will be happy to hear and work upon further suggestions. Thanks.
Regards,Karan.
I wrote an introductory thread about two weeks ago, expressing my interest in
this project. The thread grew very huge and it took me a while to aggregate the
suggestions and views of all the fellow developers of the community. Meanwhile,
I also inspected the test suite of scipy. I am putting up my conclusions and
thoughts further.
As an added information, I should specify, as earlier that I have dropped nose
and integrated pytest properly into "joblib". Some of the test suite designs
were positively affirmed by a Pytest core developer on the issue thread. Here
they go:
1. The homepage of Nose after its release of 1.3.7 states that it is no longer
maintained. I see no reason continue supporting it, as now or later we will
have to let it go. Also I am sure many prominent libraries having scipy or
numpy as dependency have already started the shift.
2. If we are using pytest, then we should make full usage of pytest alone. A
small utility library like joblib with a few hunderds of tests cut down
around 700 lines of code by adopting pytest design.
3. While testing utils can be kept independent of pytest, we should fully
embrace pytest for own own unit tests. or even better, we can thinly wrap
pytest and make array assertion possible by plain assert keyword statements
in some way. ( I haven't thought about it yet ).
4. Making the test suites just work with pytest is a matter of one PR, or a
weekend's work and I agree with developers of scikit-image. But it takes
more time to complete redesign tests in flavor of pytest, after all we have
to think about future contributors joining in. People experienced with
pytest should fine the test suite design familiar, for contributions. I
think that scikit-image has achieved the former, but still might need some
PRs for the latter ( I'm glad to help in future ).
5. Here are some notable changes which are required for pytest transition:
6. Plain assert keyword statements.Pytest's own raise and warn assert helpers
produce cleaner error logs on failure.Use pytest's parametrization to get
rid of yield based tests and form compact tests.Fixtures like tmpdir,
capsys, monkeypatch and others provided by pytest help reduce a lot of
boiler plate code.
7. Analyzing the test suite of scipy, I think that it is perfectly fine to
adopt a strategy I used before in Joblib. I will present my first draft
soon, and it will be heavily inspired from this issue thread:
https://www.github.com/joblib/joblib/issues/411 . I made around 20 PRs and
after merge of every PR, the suite was in a working condition, so keeping a
separate branch shall not be required.
I suggest on not falling back to unittests as it will increase the boilerplate
code heavily. The reason of not supporting both nosetests and pytest is because
they have different flavours, and that it would be difficult to keep up with
nose an pytest always comes with something interesting every two months in new
releases.
I will be happy to hear and work upon further suggestions. Thanks.
Regards,Karan.