This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zach.ware
Recipients Nan Wu, ezio.melotti, michael.foord, pitrou, rbcollins, zach.ware
Date 2015-12-17.04:37:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I think Ezio's suggestion of a sentinel value would be better, allowing None to be using as a legitimate 'message' [1].  That is, somewhere at global scope, define '_subtest_msg_sentinel = object()', change the msg default at Lib/unittest/ to be 'msg=_subtest_msg_sentinel', and change the check at Lib/unittest/ to check 'if message is not _subtest_msg_sentinel'.

[1] For example:

   class TruthTest(unittest.TestCase):
       def test_truth(self):
           for o in None, 1, 0, [], (4,):
               with self.subTest(o):

Should print failure results including '[None]', '[0]', and '[[]]'.
Date User Action Args
2015-12-17 04:37:02zach.waresetrecipients: + zach.ware, pitrou, rbcollins, ezio.melotti, michael.foord, Nan Wu
2015-12-17 04:37:01zach.waresetmessageid: <>
2015-12-17 04:37:01zach.warelinkissue25651 messages
2015-12-17 04:37:01zach.warecreate