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

2013-10-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 89f6abc2e115 by Ethan Furman in branch 'default': Close #19252: better test coverage for Enum. Thanks, CliffM http://hg.python.org/cpython/rev/89f6abc2e115 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open

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

2013-10-14 Thread CliffM
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. The current test works, as red is the first value to pop out of the

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

2013-10-14 Thread Ethan Furman
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

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

2013-10-14 Thread CliffM
CliffM added the comment: Yes it's purely a coverage issue. I must try to be more explicit (rather than implicit). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19252 ___

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

2013-10-14 Thread Ethan Furman
Ethan Furman added the comment: Well, I would say it's half a coverage issue, half a guard against accidental deletion of the if test. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19252

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

2013-10-13 Thread CliffM
New submission from CliffM: test_nonhash_value tests the lookup of an Enum Member from a value. The current test does not exercise the iteration over values completely -- the if-clause being redundant wrt the existing test. My patch adds an additional test which requires the if-clause.

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

2013-10-13 Thread Ethan Furman
Ethan Furman added the comment: I'm not sure what you are talking about. Here's the code: try: if value in cls._value2member_map_: return cls._value2member_map_[value] except TypeError: # not there, now do long search -- O(n) behavior for member in