Skip to content

Comparison with unittest2 #1476

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

Closed
philfreo opened this issue Mar 22, 2016 · 3 comments
Closed

Comparison with unittest2 #1476

philfreo opened this issue Mar 22, 2016 · 3 comments

Comments

@philfreo
Copy link

Apologies if this question is too broad, but I didn't see anywhere in the documentation where you explicitly compare pytest to unittest2. It would be nice to understand what high level use cases pytest solves over unittest2.

One article for example states:

Although with unittest2 the convenience of py.test is coming to the standard library.

from http://halfcooked.com/presentations/pyconau2013/why_I_use_pytest.html

(e.g. now that unittest2 is available, does this mean I shouldn't use pytest?)

@nicoddemus
Copy link
Member

Hi @philfreo,

That article is quite old, so it might not be a good reference.

According to PyPI:

unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7 and onwards.

It basically allows you to use unittest features released in Python 3+ in Python 2.7, so I suspect that sentence in the article refers that unittest2 has test auto discovery, which pytest has had for a long time, along with a ton of other features not available in unittest or unittest2.

To an overview of all features of py.test, nose and unittest I suggest the excellent pythontesting.net.

HTH!

@philfreo
Copy link
Author

Thanks

Overall I would suggest still adding a bit more of an explanation to https://pytest.org/latest/faq.html#how-does-pytest-relate-to-nose-and-unittest, outlining some of the major features/differences

@nicoddemus
Copy link
Member

Thanks for the suggestion. I created a separate issue in #1477, so I'm closing this one for now. 😁

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

2 participants