testtools-dev team mailing list archive
-
testtools-dev team
-
Mailing list archive
-
Message #00681
Re: [Merge] lp:~kampka/testtools/assert-is-none into lp:testtools
The code looks fine and will clearly work; Do you want these for
compatibility with unittest2, or as a convenient spelling?
For the latter, I actually prefer:
self.assertThat(something, Is(None))
and
self.assertThat(something, Not(Is(None)))
These are only slightly shorter spellings:
self.assertThat(something, Is(None))
self.assertIsNone(something)
and
self.assertThat(something, Not(Is(None)))
self.assertIsNotNone(something)
I'm vaguely against (e.g. -0) on this on the idea that we should focus
on making the matchers really easy to reach out and use; OTOH a
compatibility argument for folk wanting to port code over is
reasonably strong.
A separate idea: perhaps we should have a testtools.TestCase2 or
testtools.ut2.TestCase class which offers complete compatibility with
python/unittest2 - assertRaises returning a context manager etc; it
could expose our new stuff too but make it really easy for folk to
port over.
-Rob
--
https://code.launchpad.net/~kampka/testtools/assert-is-none/+merge/64868
Your team testtools developers is subscribed to branch lp:testtools.
References