Hacker News new | ask | show | jobs
by teddyh 1578 days ago
unittest is included in the Python standard library. Adding third-party libraries is a huge step to take for a project, and just “nicer to work with” does not cut it. Third-party libraries come and go, and depending on one means being subject to the storms of changes and lulls of inactivity and death. But the standard library is dependable.
1 comments

> Adding third-party libraries is a huge step to take for a project

Really? I've can't think of a "real" project that did not include 3rd party libs.

Reinventing wheels or struggling with poorer implementations (unittest vs pytest, http vs requests, etc) is huge drain for a project. A huge misstep.

I should have written “Adding each extra third-party library as an additional dependency is always a huge step to take for a project”.

Any one third-party library comes with these drawbacks, and each library must be evaluated individually. Some may be worth the pain (requests, etc.), but many are not. One should try to minimize the number of third-party dependencies one has, not necessarily eliminate them entirely. It’s simply that the lower number of third-party libraries you depend on, the less pain you get of the kinds I listed. Every individual third-party library will have to overcome that threshold by being useful enough. And I doubt that, for most people, pytest is that much better to work with than the built-in unittest is.

From the article:

> While pytest is very popular, 28% of codebases still use the built-in unittest package.

Yes? This proves that the writer thinks that everybody should obviously change from unittest to pytest. It does not prove the writer to be correct in all circumstances. Each project should make their own determination of whether a third-party library is worth it.
No, that doesn't prove that. It just indicates the opposite of what you said, here:

> And I doubt that, for most people, pytest is that much better to work with than the built-in unittest is.

Then why did you quote the author so selectively as to appear to indicate the opposite?