Ken Youens-Clark wrote:Pytest was most similar to testing frameworks I knew from Perl. I simply found it to be the most immediately useful and easy to learn. I also avoid object-oriented programming, and unittest seemed more amenable to OOP libraries. I used pytest in the classroom with beginner students, and they seemed to have no problem picking up the basic ideas. The output from pytest when tests fail is pretty great, so it just seemed like the easiest path. There certainly are many other great testing libraries, and pytest can integrate with them (such as unittest). TL;DR: pytest is pretty simple and effective.
I very much agree with you -
PyTest is also my go to framework for most use cases, and I understand why you as a teacher decided to introduce it to the beginner students and in the book. However, I think for web-related use cases (mock requests), PyTest does not play well with function decorators that add positional arguments to the test functions and I would probably use something else in that case (
nose2 +
requests).
Thank you very much for the response.