updated test suite support
Robert Collins
robertc at robertcollins.net
Mon Aug 29 11:12:56 BST 2005
On Thu, 2005-08-25 at 22:11 -0400, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Robert Collins wrote:
> > There are now two distinct base classes for writing test cases:
> > bzrlib.selftest.TestCase and bzrlib.selftest.FunctionalTestCase
> > The former is appropriate for any 'memory-only' test cases that you
> > write. It sets up a log and captures mutter() etc calls.
> > FunctionalTestCase's setup constructs a temporary directory for your
> > test to run in and chdirs you to it.
>
> I'm not sure about those names. InTempDir is a lot more obvious. I'm
> not sure why testing an ImmutableStore would be 'functional', but
> testing some iterator behavior would not be.
>
> Aside from that, these changes look really good.
There are a couple of reasons that drove my naming. One is a convention
from testing that unit tests do not deal with external resources - they
only operate in memory and typically are extremely small and precise in
nature. Tests that do more, particularly those that act on external
resources, are often referred to as functional tests. Another is that
InTempDir could be anything - the only reason someone reading the code
would realise that that is a TestCase is by chasing two levels of
pointers - the source they are in -> selftest.py -> testsweet.py.
Calling it TestCaseInTempDir would be ok with me. Note that its
providing more than just chdiring now, it also provides the run-external
process facility.
some tests that might be written for an ImmutableStore are functional in
nature, and some are unit tests - the ones that were present were all
functional in nature.
Cheers,
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050829/2822f86f/attachment.pgp
More information about the bazaar
mailing list