You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error message formatting errors in int object unit-test script #69398
Thanks for the patch, it looks correct. The Frm class takes a variable number of *args, and then returns “format % args”. It should at least be applied to the 2.7 branch.
For 3.4+, perhaps we can eliminate the need for the Frm class altogether, by using TestCase.subTest():
Here is a my alternative proposal for 3.4+, dropping the Frm class and using subTest() instead. I kept some error messages where I thought they added clarity, but dropped most because I thought they were redundant with the test code and subTest() parameters.
The test file takes a bit longer to run as a consequence of my patch (was 6.3 s, now 7.3 s). However I think the simpler and more maintainable code outweighs this.
Activity
s-wakaba commentedon Sep 22, 2015
I've found some parts there are illegal message formatting in int object unit test script "Lib/test/test_long.py" when hacking the interpreter.
because they were an easy problem, I already fixed them to promote my work.
Therefore, the patch has been attacked.
thanks
vadmium commentedon Sep 22, 2015
Thanks for the patch, it looks correct. The Frm class takes a variable number of *args, and then returns “format % args”. It should at least be applied to the 2.7 branch.
For 3.4+, perhaps we can eliminate the need for the Frm class altogether, by using TestCase.subTest():
vadmium commentedon Sep 24, 2015
I will commit your patch to 2.7.
Here is a my alternative proposal for 3.4+, dropping the Frm class and using subTest() instead. I kept some error messages where I thought they added clarity, but dropped most because I thought they were redundant with the test code and subTest() parameters.
The test file takes a bit longer to run as a consequence of my patch (was 6.3 s, now 7.3 s). However I think the simpler and more maintainable code outweighs this.
python-dev commentedon Sep 24, 2015
New changeset e2f1f69d0618 by Martin Panter in branch '2.7':
Issue bpo-25211: Fix error message code in test_long; patch from s-wakaba
https://hg.python.org/cpython/rev/e2f1f69d0618
berkerpeksag commentedon Sep 24, 2015
subTest-long.patch looks good to me. Thanks!
python-dev commentedon Sep 26, 2015
New changeset 697781ff3b49 by Martin Panter in branch '3.4':
Issue bpo-25211: Eliminate lazy error message class by using subTest
https://hg.python.org/cpython/rev/697781ff3b49
New changeset 6e11708dcb3b by Martin Panter in branch '3.5':
Issue bpo-25211: Merge test_long from 3.4 into 3.5
https://hg.python.org/cpython/rev/6e11708dcb3b
New changeset 11ad44d4177f by Martin Panter in branch 'default':
Issue bpo-25211: Merge test_long from 3.5
https://hg.python.org/cpython/rev/11ad44d4177f