classification
Title: Check calculated constants in test_string.py
Type: enhancement Stage: needs patch
Components: Tests Versions: Python 3.5, Python 3.4, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, JoelLuellwitz, Lynne.Qu, benjamin.peterson, brian.curtin, terry.reedy
Priority: normal Keywords: easy, patch

Created on 2011-04-03 19:52 by Lynne.Qu, last changed 2014-06-28 03:40 by terry.reedy.

Files
File name Uploaded Description Edit
test_calculated_constants.diff Lynne.Qu, 2011-04-03 19:52
test_calculated_constants.diff JoelLuellwitz, 2011-04-03 20:32
Messages (6)
msg132874 - (view) Author: Lynne Qu (Lynne.Qu) Date: 2011-04-03 19:52
Changed test to check calculated constants in test_string.py
msg132879 - (view) Author: Joel Luellwitz (JoelLuellwitz) Date: 2011-04-03 20:32
Make a slight change to diff file.
msg132981 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011-04-04 22:12
Being rather circular, that doesn't seem to be a particularly useful test. (Not that the original is either.) It'd be more "correct" if you actually tested that hex numbers are contained within string.hexdigits, for example.
msg133347 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-04-08 22:36
I do not understand 'circular'. The change is from 'attribute exists' to 'attribute has correct value'. If any are changed, I would think all should be changed.
msg221738 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-27 21:27
I see very little value in implementing this change, thoughts?
msg221766 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-06-28 02:02
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.
History
Date User Action Args
2014-06-28 03:40:05terry.reedysettitle: Changed test to check calculated constants in test_string.py -> Check calculated constants in test_string.py
2014-06-28 02:02:51terry.reedysetkeywords: + easy
type: behavior -> enhancement
messages: + msg221766

stage: needs patch
2014-06-27 21:27:41BreamoreBoysetnosy: + BreamoreBoy

messages: + msg221738
versions: + Python 2.7, Python 3.4, Python 3.5, - Python 3.3
2011-04-08 22:36:16terry.reedysetnosy: + terry.reedy
messages: + msg133347
2011-04-04 22:12:14benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg132981
2011-04-04 16:12:23brian.curtinsetnosy: + brian.curtin
2011-04-03 20:32:23JoelLuellwitzsetfiles: + test_calculated_constants.diff
nosy: + JoelLuellwitz
messages: + msg132879

2011-04-03 19:52:26Lynne.Qucreate