[issue19252] Enum.py : Enum.__new__() : Test Coverage

Ethan Furman report at bugs.python.org
Mon Oct 14 16:08:36 CEST 2013


Ethan Furman added the comment:

CliffM added the comment:
>
> Sorry -- I could have been clearer :
>
> The conditional:
>
>   if member.value == value:
>
> Is redundant as the tests stand.  If you comment it out -- everything works. So therefore we are missing a test.

Are you saying that you are commenting out the if test, but leaving in the return member?

> This makes the if-clause fragile for future maintenance.  So we need another test to ensure the loop is covered.

In case Python for loops suddenly stop working?

Sorry to be so dense, but I am not understanding the point you are trying to make... ahhhhhh!  Are trying to guard 
against the possibility that in the future someone might accidentally delete the if test, and the unit test won't catch 
it?  That certainly is a good reason to test values further into the loop.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19252>
_______________________________________


More information about the Python-bugs-list mailing list