Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Disagree on pytest: it's the first testing framework I've used in ANY language which has genuinely made me enjoy writing tests.

It has a bit of an initial learning curve, but once you understand how fixtures work it's amazing how productive you can be with it.



I wish I could agree. Every aspect of pytest that I like (fixtures, plugins, etc.) is marred by a boneheaded move to make them autoloaded by default. Loading should be explicit/opt-in. It's dumv that if you pip install something that adds a new pytest plugin it'll automatically modify your runtime behavior. Some of the plugins are great (shoutout to pytest-socket), but it has the same issue flake8 has with the plugin ecosystem where the quality varies wildly.

I might be in the minority but I also find python's mock implementation awful. Mockito in Java is way better where you explicitly state which calls you expect and if you get an unexpected call it errors out.


The implicit magic makes writing pytest tests painless.

Also with improvement of type hinting, tooling like PyCharm starts to understand pytest better and make it easier to read and manage and a lot of the magic can be dispellt by written out explicitly. Though this need some discipline from the dev team.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: