On Sun, Aug 27, 2017 at 4:25 AM, francismb <[email protected]> wrote: > Hi all, > while using `unittest` I see the pattern of creating an error message > with the test context for the case that some `assert...` methods fails > (to get a good error message). On the lines: > > class Test...(unittest.TestCase): > > longMessage = True > > def test_(self): > ... > for a, b, c ... in zip(A, B, C, ..): > * call the function under test and get the result > msg = "Some headline: {}{} ...".format(a, b, c,..) > self.assert...( ,msg) > > The `msg` is just used in case the assert fails but its creation takes > time and adds up.
Have you measured it, eg by replacing the message with a constant? By what percentage does it speed up a successful test run? ChrisA _______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
