Blackbox tests not being run
John A Meinel
john at arbash-meinel.com
Mon Feb 6 13:56:39 GMT 2006
Robert Collins wrote:
> On Fri, 2006-02-03 at 09:35 -0500, Aaron Bentley wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hi all,
>>
>> Thanks to Belchenko's report, I've determined that the blackbox tests
>> are not being run. Here is a patch. It's also in bzr.ab.
>>
>> I have no clue how to add a test case for this :-)
>
> in test_selftest.py
>
> class insanelyMetaTests(TestCase):
>
> def module_tests_loaded(self):
> suite = bzrlib.tests.suite()
> modules = set(['blackbox', 'branch_implementations',
> 'transport_implementations', ...])
> for test in iter_suitetests(suite):
> found = set()
> for name in modules:
> if test.id().contains('.' + name + '.'):
> found.add(name)
> modules.remove(found)
> self.assertEqualSet(modules, set())
>
>
>
> But I think this is unuseful because its not testing module loading code
> per se, rather its testing that our user-data has not been meddled with.
>
> Rob
>
I was thinking an alternative test, which would just check for any files
named "test_*" underneath the tests directory. And make sure that they
were all loaded. That also helps with the "accidentally deleting a test
because of a merge conflict."
However, if we write that, I have to wonder why we aren't just grabbing
all files named test_*.py and automatically including them in the tests.
It would mean less maintenance work when writing new tests.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060206/da07e755/attachment.pgp
More information about the bazaar
mailing list