News for hackers. Stuff that matters.
Re:Solving Algorithmic Problems in Python with Pytest (2019) by henrikeh on Saturday December 19, 2020 @11:30AM (#25478466)
> unittest is an old horse and cart, while pytest is the batmobile.

I really wish more was said than just this. Why is it that pytest is often preferred and unittest is considered a bad choice? What is the impact on the quality of the tests?

Re:Solving Algorithmic Problems in Python with Pytest (2019) by andreareina on Saturday December 19, 2020 @12:06PM (#25478877)
Pytest:

- lets you use regular assert statements, rather than assertEqual, assertTrue, etc.

- does not impose the use of classes

- the way it does fixtures just feels nicer to use than unittest

Basically, it's more ergonomic and IME more flexible.