[issue18106] There are unused variables in Lib/test/test_collections.py

Vajrasky Kok report at bugs.python.org
Fri May 31 12:40:51 CEST 2013


Vajrasky Kok added the comment:

According to R. David Murray in Python core-mentorship mailing list addressing me:

"It could be that the bug is that the i is not used...it may have been
intended to be used in an extended error message in the asserts, so that
it would be clear which input failed.  In any case, I think the best
fix here would probably be to use the new subtests support in unittest."

So I used subTest feature in the second patch I upload according to his advice.

What do you think? subTest can recognize where the test fails immediately as well. You just have to count the line in the loop.

----------
Added file: http://bugs.python.org/file30433/test_copying_with_subTest.patch

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


More information about the Python-bugs-list mailing list