[Cuis-dev] Enhancement proposal: Fail test when no assertion ran

Hernán Wilkinson hernan.wilkinson at 10pines.com
Wed Apr 3 10:34:46 PDT 2024


That is a good point, but there is an "agreement" around the automatic
testing people on making explicit that you are not expecting an exception,
differentiate that test from the ones that do not have assertions by
mistake.
I do believe it is better to do it that way, it makes explicit what you are
expecting and if the framework testing changes (like in this case is
suggested), the test will continue working.
I think that explicit is better than implicit in many areas, programming
languages is one of them; python has that as a rule for example.
I think making explicit that you are not expecting an exception to be
signaled is better than not doing it.

Hernan.





On Wed, Apr 3, 2024 at 2:22 PM Andres Valloud via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> No, you can write code in a test method with the expectation that it
> will not raise unhandled exceptions, and you do not need assertions for
> that.  Specifically, you do not need to write the silly
>
>         shouldnt: [...] raise: UnhandledException
>
> because that's what SUnit is there for.  You do not know a priori what
> the code writer is doing, so the tool should not guess.
>
> On 4/3/24 7:42 AM, Juan Vuletich via Cuis-dev wrote:
> > a test without assertions is not a test.
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240403/6b8de439/attachment.htm>


More information about the Cuis-dev mailing list