4 ms·
What are people using in terms of testing frameworks now?
by tjpnz 6y ago
What are people using in terms of testing frameworks now?
- globular-toast 6y agoMost of the codebases I maintain use unittest, but pytest is much better and my preferred framework.
- teddyh 6y agounittest is in the standard library; this counts for a lot.
- globular-toast 6y agoI used to use unittest for this reason, but it's pretty silly. Having extra dependencies for the tests makes no difference for end users and these days it barely makes a difference to developers.
- codethief 6y ago> Having extra dependencies for the tests What do you mean, extra dependencies? The only difference between pytest and unittest in this regard is that tests using unittest declare their dependency explicitly, using an import[0]. Most pytest tests still implicitly require pytest as a dependency, though. (Think of fixtures etc. etc.) I actually like unittest's approach here – in my book, explicit is better than implicit.
- GlennS 6y agoI believe they mean that you need to install the pytest package, whereas unittest comes with Python.
- Rendello 6y agoThis is a good talk by the core developer Raymond Hettinger [1]. He prefers pytest too. I don't do any crazy testing, but I really like property-based testing with Hypothesis, which is also mentioned. This video isn't Python but it's a great intro to property-based testing [2]. 1. https://www.youtube.com/watch?v=ARKbfWk4Xyw https://www.youtube.com/watch?v=ARKbfWk4Xyw 2. https://www.youtube.com/watch?v=AfaNEebCDos https://www.youtube.com/watch?v=AfaNEebCDos
- codethief 6y agoWhat makes pytest so much better in your opinion?