On Fri, Nov 12, 2021, 1:39 AM Christopher Barker <python...@gmail.com>
wrote:

>
> unittest is the first (and only) testing framework I have ever used, so
>> any info is appreciated.
>
>
> Yes, I like Pytest a lot more.
>
> I should really write this up someday, and I did write a bit about it on
> this list not too long ago.
>
> So the really short version is:
>
> Unittest requires a fair bit of boilerplate that adds no real
> functionality.
>
> The assert* methods are only there to provide error reporting that can be
> done by introspection by the test runner (e.g. pytest)
>
> It’s missing some really key features like paramatrized tests.
>
> Give Pytest a try — I suspect you’ll like it.
>
> Note that a LOT of major projects dumped unittest years ago— first for
> nose and now usually pytest. No one uses a third party library for no
> reason :-)
>
> -CHB
>

In my humble opinion, the only two valid reasons to use unittest are if you
are writing tests for Python itself, or if you are operating in a locked
down enterprise environment where PyPI is off-limits and you have to rely
on the stdlib. All other cases should use pytest or something similar (or
in a security-conscious environment, petition the appropriate people to
evaluate and approve pytest).

>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/5MWKWL7XHA34RLSVXBVMQALTWCRGQJGP/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to