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 serhiy.storchaka
Recipients ezio.melotti, michael.foord, pitrou, serhiy.storchaka, terry.reedy, vajrasky
Date 2013-06-01.19:06:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAAuNNr7Tu1QZVY+HDu-Mfpi2qmLRa+8uqx_6YCew8RuBQtoOmw@mail.gmail.com>
In-reply-to <1370110359.19.0.00261067002.issue18106@psf.upfronthosting.co.za>
Content
subTest() serves two purposes: identify the test case and continue testing
oother test cases after a fail. For first purpose subTest() is not well
suitable in these tests, becouse we have no a string which determine a
test. Second purpose is not relevant to original issue.

1. a fancy formatted message would be more useful with less fluff and the
> two displays each on their own line.
>
> msg = "iteration %s\ncopy: %s\norig: %s" % (i, dup, words)
> # or od for OrderedDict test
>

When the test fails, dup is not expected value and printing it can raise an
exception and prevent formatting useful error message. Failure report
should be succesful in any case.

3. wrap the bodies of both loops with 'with self.subTest():' to always test
> all dups. Unrolling the loops prevents doing this.
>

Of course you can wrap a body of the check() function.
History
Date User Action Args
2013-06-01 19:06:41serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy, pitrou, ezio.melotti, michael.foord, vajrasky
2013-06-01 19:06:40serhiy.storchakalinkissue18106 messages
2013-06-01 19:06:38serhiy.storchakacreate