Issue 26869: unittest longMessage docs (original) (raw)

Created on 2016-04-27 07:47 by guettli, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue26869.patch Mariatta,2016-10-05 04:20 review
Messages (7)
msg264359 - (view) Author: Thomas Guettler (guettli) * Date: 2016-04-27 07:47
The first message of the longMessage docs is confusing: https://docs.python.org/3/library/unittest.html#unittest.TestCase.longMessage > If set to True then .... This reads between the lines, that the default is False. But that was long ago in Python2. In Python3 the default is True (which I prefer to the old default). I think the docs should be like. And the term "normal message" is not defined. For new comers the "normal message" is what I get if you don't change the default, not the behaviour of the Python2 version :-) I think "normal message" should be replaced with "short message" or "diff message" .. I am unsure. What do you think?
msg264382 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-04-27 17:35
Replace existing description with "This class attribute determines what happens when a custom failure message is passed as the msg argument to an assertXYY call that fails. If True, the default, the custom message is appended to the end of the standard failure message. If False, the custom message replaces the standard message. The standard failure message for each *assert method* contains useful information about the objects involved. For example the message from assertEqual shows the repr of the two unequal objects. It is usually easier to augment rather than replace this message The class setting can be overridden in individual test methods by assigning an instance attribute, self.longMessage, to True or False before calling the assert methods. New in version 3.1."
msg264424 - (view) Author: Thomas Guettler (guettli) * Date: 2016-04-28 09:20
Thank you for understanding my concern. > The standard failure message for each *assert method* contains useful > information about the objects involved. For example the message from > assertEqual shows the repr of the two unequal objects. It is usually > easier to augment rather than replace this message I think above is not needed. > The class setting can be overridden in individual test methods by > assigning an instance attribute, self.longMessage, to True or False > before calling the assert methods. I would add "the default value of the class gets reset before each test call". That is more explicit (I hope my text is what happens behind the scene) Again, thank you, that you care. Regards, Thomas Güttler
msg278100 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2016-10-05 04:20
Hi, please review the updated documentation. Thanks.
msg278442 - (view) Author: Thomas Guettler (guettli) * Date: 2016-10-10 19:52
@Mariatta thank you very much. This update makes the docs easy to read and understand. Thank you :-)
msg278618 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-10-13 21:24
New changeset 7eb4fe57492f by Guido van Rossum in branch '3.5': Issue #26869: Document unittest.TestCase.longMessage. (Mariatta) https://hg.python.org/cpython/rev/7eb4fe57492f New changeset d7279d803d1d by Guido van Rossum in branch '3.6': Issue #26869: Document unittest.TestCase.longMessage. (Mariatta) (3.5->3.6) https://hg.python.org/cpython/rev/d7279d803d1d New changeset c7c428350578 by Guido van Rossum in branch 'default': Issue #26869: Document unittest.TestCase.longMessage. (Mariatta) (3.6->3.7) https://hg.python.org/cpython/rev/c7c428350578
msg278619 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2016-10-13 21:25
Done. Thanks!
History
Date User Action Args
2022-04-11 14:58:30 admin set github: 71056
2016-10-13 21:25:38 gvanrossum set status: open -> closednosy: + gvanrossummessages: + resolution: fixedstage: needs patch -> resolved
2016-10-13 21:24:56 python-dev set nosy: + python-devmessages: +
2016-10-10 19:52:47 guettli set messages: +
2016-10-05 04:20:52 Mariatta set files: + issue26869.patchkeywords: + patchmessages: +
2016-09-28 17:36:38 Mariatta set nosy: + Mariatta
2016-09-28 00:48:33 berker.peksag set nosy: + berker.peksagversions: + Python 3.7
2016-04-28 09:20:06 guettli set messages: +
2016-04-27 17:35:15 terry.reedy set versions: + Python 3.5nosy: + terry.reedymessages: + type: behaviorstage: needs patch
2016-04-27 07:47:47 guettli create