[MERGE] Automatic discovery of tests

Alexander Belchenko bialix at ukr.net
Wed Nov 7 06:23:30 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel пишет:
> Attached is a patch which changes how we find tests to run.
> 
> It adds a "bzrlib.tests.load_and_adapt_modules" function, which allows us
> to simply find tests which need to be run based on the module names. This
> means that we don't need to explicitly list the name of new test files.
> I've actually been using some of this code in plugins that I've written,
> and I've found it very nice to just pop a new "test_foo.py" file into my
> tests/ directory and have it just work.
> 
> It is set up so that at package levels (foo/__init__.py) you can define
> your own "test_suite()" function, which it will call, rather than
> auto-discovering any tests that are present. This is what allows us to
> have 'repository_implementations/' use a different adapter than other
> subdirectories.
> 
> Overall, I think this greatly simplifies the implementations of
> 'test_suite()', and it means we just have less mental overhead to managing
> our tests.
> 
> Off-hand, the only downside is that it will break for the standalone
> bzr.exe. It could certainly be updated to look in .zip files if we really
> want to bring that back. But as 'bzr.exe' is meant as an installed
> executable, I'm not sure that we really need to have the test suite
> available. (Developers need to run the test suite more than users need
> to.) 

In my understanding test suite inside bzr.exe is only bloat standalone distribution.
So I'm OK if it won't work for exe.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHMVnizYr338mxwCURAhUzAKCFI2rKujv2OsQv2MAi5B9OYBC63ACeJ117
4Zg2rfP87/IeJHJkTAq38Vk=
=GOng
-----END PGP SIGNATURE-----



More information about the bazaar mailing list