[MERGE] make init-repo use '.' as default location
Ben Finney
bignose+hates-spam at benfinney.id.au
Sat Jul 12 23:41:21 BST 2008
Scott Scriven <bzr at toykeeper.net> writes:
> But... after looking at unittest.py, I can say "assertTrue" is
> misleading. It doesn't assert(expr is True) or even assert(expr ==
> True). Instead, it's equivalent to assert(not not expr).
I've extended unittest.TestCase with several more assertion methods
(as I'm sure many others have done). I've made analogues of:
TestCase.failIfEqual(first, second)
TestCase.assertNotEqual(first, second)
TestCase.failUnlessEqual(first, second)
TestCase.assertEqual(first, second)
as
TestCase.failIfIs(first, second)
TestCase.assertNotIs(first, second)
TestCase.failUnlessIs(first, second)
TestCase.assertIs(first, second)
which simply use the 'is' operator instead of the '==' operator.
This makes the narrower 'assertTrue' redundant:
self.assertIs(True, expr)
while also allowing for testing many other identity comparisons.
--
\ “I must say that I find television very educational. The minute |
`\ somebody turns it on, I go to the library and read a book.” |
_o__) —Groucho Marx |
Ben Finney
More information about the bazaar
mailing list