[issue25211] Error message formatting errors in int object unit-test script

Martin Panter report at bugs.python.org
Tue Sep 22 11:11:04 CEST 2015


Martin Panter added the comment:

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():

def check_bitop_identities_1(self, x):
    eq = self.assertEqual
    with self.subTest(x=x):
        eq(x & 0, 0)
        ...
        for n in range(2*SHIFT):
            p2 = 2 ** n
            with self.subTest(n=n, p2=p2):
                eq(x << n >> n, x)
                ...
                eq(x & -p2, x & ~(p2 - 1))

----------
nosy: +martin.panter
stage:  -> patch review
versions: +Python 2.7, Python 3.4, Python 3.6

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


More information about the Python-bugs-list mailing list