[issue11754] Changed test to check calculated constants in test_string.py

Terry J. Reedy report at bugs.python.org
Sat Jun 28 04:02:51 CEST 2014


Terry J. Reedy added the comment:

Three years later, I do understand 'circular'. Such cut-and-paste whitebox tests tend to simultaneously test too much -- the particular implementation(1) -- and too little -- the actual specification(2).

(1) The test would falsely fail if a string were reordered but still correct.
(2) The test would falsely pass is any of the existing strings were incorrect. Most of the strings have a specification other than the existing string and all can be tested in an order free manner. Hexdigits example:

import string
assert len(set(string.hexdigits)) == 22
for c in string.hexdigits:
    assert '0' <= c <= '9' or 'a' <= c <= 'f' or 'A' <= c <= 'F'

I would be willing to push such a patch. I would also be willing to close this now.

----------
keywords: +easy
stage:  -> needs patch
type: behavior -> enhancement

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


More information about the Python-bugs-list mailing list