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) *  |
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) *  |
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) *  |
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. |
|
|
msg240734 - (view) |
Author: chalmer_lowe (chalmerlowe) * |
Date: 2015-04-13 20:29 |
Discussed with David Murray at PyCon Sprints 2015. Considered the fact that to preserve backwards compatibility, it seems important that rather than a) merely checking for the presence of each constant string (as the test does now) OR b) checking for each desired character (regardless of order) as noted in the tests should check for the exact strings that have historically been published in Python. Doing so seems to be the right path to ensure that: a) the strings exist AND b) the strings have not inadvertently changed. |
|
|
msg240751 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2015-04-13 21:06 |
Added a review comment. |
|
|
msg240803 - (view) |
Author: chalmer_lowe (chalmerlowe) * |
Date: 2015-04-13 23:13 |
Based on review comments, in order to reduce unnecessary redundancy in the tests: - composed later strings from previously defined substrings, where it made sense to do so. |
|
|
msg240812 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2015-04-14 00:08 |
New changeset e1457e9f340f by R David Murray in branch 'default': #11754: test contents of string module attributes. https://hg.python.org/cpython/rev/e1457e9f340f |
|
|
msg240813 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2015-04-14 00:11 |
Thanks, Chalmer. Hopefully Benjamin won't be too annoyed by these :) |
|
|