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

Plan: Switch from nose to nose2 (or another utility like py.test) #77

Open
winem opened this issue Apr 27, 2021 · 3 comments
Open

Plan: Switch from nose to nose2 (or another utility like py.test) #77

winem opened this issue Apr 27, 2021 · 3 comments

Comments

@winem
Copy link

winem commented Apr 27, 2021

I hope this is the right place to raise the topic. Please let me know if we rather wanna have it in the st2 repository for example.

I came across the note to users on the nose web page https://nose.readthedocs.io/en/latest/:

Nose has been in maintenance mode for the past several years and will likely cease without a new person/team to take over maintainership. New projects should consider using Nose2, py.test, or just plain unittest/unittest2.

So it is not an urgent topic but we may want to consider a switch to another solution for our tests with an upcoming release.

The most obvious one would be nose2 although it's a new project and not a drop-in replacement that covers all of the nose features.

I'll take a closer look at our test suite and add additional details (implications, limitations, ...) in the comments.

@Kami
Copy link
Member

Kami commented Apr 27, 2021

Yeah, I agree - nose is not maintained anymore, but it's also not an urgent or high priority change since it works fine for us (and there are no active vulnerabilities or similar, as far as I am aware of).

We also utilize many nose plugins (nose timer, nose parallel, xdist, coverage, etc.) so migration would probably take more time and effort (and we would also need to check pytest / similar offers plugins to achieve feature parity with our current setup).

I would personally vote for pytest (which we are already using for micro benchmarks).

But yeah, per my comment above, my main question would be what is our objective / what we are trying to achieve with the migration? Is there any specific functionality missing in nosetests? Or is it purely because it's not actively maintained anymore?

For me personally, nose works fine right now and there is no missing functionality or similar which would warrant migration (well, micro benchmarks functionality was missing, but that change is relatively isolated so I just used pytest for new micro benchmarks).

@Kami
Copy link
Member

Kami commented Apr 27, 2021

And for completeness sake, here are PyPi download stats for those 3 projects:

I would argue that if we do decide to do the migration, we should probably go something which is actively used and supported by the community (aka pytest seems to have much more usage than nose2).

@cognifloyd
Copy link
Member

I prefer pytest.
When a test is failing, I have a hard time getting good debug output from nose like I can from pytest. The error messages in pytest are more helpful to me. Printing locals is very helpful. And pytest can be much less verbose when a test passes so you don't have to dig through so much ci churn to find the failures.

I also prefer the plain asserts when writing tests, though pytest supports running all the unittest style tests, so we should be able to use pytest as a test runner without changing the test style.

As for the plugins, nothing we're using with nose test is very esoteric. I believe the relevant features are included in pytest, or there are common plugins that so something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants