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 gvanrossum
Recipients benjamin.peterson, giampaolo.rodola, gpolo, gregory.p.smith, gvanrossum, pitrou, pupeno, purcell, rhettinger
Date 2009-03-29.16:13:51
SpamBayes Score 8.9117935e-11
Marked as misclassified No
Message-id <1238343235.4.0.585437036124.issue2578@psf.upfronthosting.co.za>
In-reply-to
Content
The naming pattern (assertListEqual, assertDictEqual, etc.) is pretty
easy to pick up so I don't think the addition of several new methods is
a big deal.  Making assertEqual() do the right thing all the time is
hard if there are subclasses that might override __eq__ or do other
tricks, so I am glad that Greg only put the simplest test possible in
assertEqual.  And I would still want to have a way to explicit *disable*
that in case I am comparing containers with millions of items.  New
assertions like assertSameElements, assertDictContainsSubset or
assertMultilineEqual are not things that can be guessed, and they *are*
useful.

The names are also trivial to understand when reading tests that someone
else wrote, so I am not so worried about the cognitive effort.  I would
rather start deprecating the fail* variants and use assertTrue in favor
of assert_, and settle the question of whether to prefer assertEqual vs.
assertEquals (the former, please).

Finally, a simple refactoring of the code might be helpful where the
preferred name for each function is actually the name used in the 'def'
for it, so that tracebacks involving such assertions show the preferred
names, and so that their definitions can be found by searching the code
for e.g. "def assertEqual".
History
Date User Action Args
2009-03-29 16:13:56gvanrossumsetrecipients: + gvanrossum, rhettinger, gregory.p.smith, purcell, pitrou, giampaolo.rodola, pupeno, benjamin.peterson, gpolo
2009-03-29 16:13:55gvanrossumsetmessageid: <1238343235.4.0.585437036124.issue2578@psf.upfronthosting.co.za>
2009-03-29 16:13:54gvanrossumlinkissue2578 messages
2009-03-29 16:13:52gvanrossumcreate