Skip to content
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

Switch testing to pytest? #1280

Closed
arokem opened this issue Jun 28, 2017 · 8 comments · Fixed by #1652

Comments

@arokem
Copy link
Member

commented Jun 28, 2017

I have a feeling we've discussed this before. Nose is no longer being developed, and from what I have heard and experienced myself, it looks like pytest (https://docs.pytest.org/en/latest/) is a good way to go. Looks like maybe nose2 is also an option (http://nose2.readthedocs.io/en/latest/).

@skoudoro

This comment has been minimized.

Copy link
Member

commented Jun 28, 2017

I do not think nose2 is a good option (last commit January 3rd). Pytest is actively and better maintained and I agree with you when you said it is way to go (as soon as possible).

@thechargedneutron

This comment has been minimized.

Copy link
Contributor

commented Feb 2, 2018

What exactly needs to be done here? As far as I can infer, I need to remove all dependencies on nose and replace it with pytest. Anything else (like changing travis file etc.) ??

@arokem

This comment has been minimized.

Copy link
Member Author

commented Feb 2, 2018

Yes. That's the gist of it. And indeed, travis config would also need to be adjusted to use pytest.

Things might get complicated, though. For example because of older numpy.testing dependency on nose.

Because of the sensitivity of this kind of change, it would be good to discuss the strategy towards changing this. For example, do we want to change it all in one fell swoop, or do we envision having an intermediate stage that depends on both pytest and nose, until we can stabilize?

@skoudoro

This comment has been minimized.

Copy link
Member

commented Feb 2, 2018

I made a really quick test: pytest --doctest-modules --durations=10 -svv dipy and the result was quite positive !

  • 80% of tests run without any failure on OSX python 3.
  • 20% do not run.

Base on that, I think it will be better to avoid the intermediate stage. Of course, this is a preliminary thought, many chances that I do not see all tricky part

@thechargedneutron

This comment has been minimized.

Copy link
Contributor

commented Feb 2, 2018

Okay I'll try over this weekend. Can you guide me on how to build the tests locally so as to check if the changes do not affect current behaviour?

@jhlegarreta

This comment has been minimized.

Copy link
Contributor

commented Feb 6, 2018

I can also work on it during the weekend if the work can be shared/divided.

@thechargedneutron

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2018

@skoudoro @arokem Can we use unittests as well? There are certain functions including SkipTest and TestProgram which are there in unittests. Pytest does not have (probably) these mentioned functions. PR #1414

@arokem

This comment has been minimized.

Copy link
Member Author

commented Feb 13, 2018

Doesn't this work for skipping?

https://docs.pytest.org/en/latest/skipping.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.