Blackbox tests not being run

John A Meinel john at arbash-meinel.com
Sun Feb 5 00:01:16 GMT 2006


John A Meinel wrote:
> Aaron Bentley wrote:
>> 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 :-)
>>
>> Aaron
> 
> good catch, +1 from me.
> 
> John
> =:->

As a part of fixing this, I would also like to fix
'blackbox/__init__.py' so that it uses the same _load_module code that
tests/__init__.py uses. So I propose the following patch.

(The big reason is it turned out I messed up test_status.py when I
merged it. After re-enabling blackbox tests, I started getting the
'module has no member named "test_status.py"' which is the really
unhelpful error message.

Can I get a +1 so that I can commit it?

John
=:->


=== modified file 'bzrlib/tests/__init__.py'
--- bzrlib/tests/__init__.py
+++ bzrlib/tests/__init__.py
@@ -83,6 +83,7 @@
     import bzrlib.tests.branch_implementations
     return [
             bzrlib.doc,
+            bzrlib.tests.blackbox,
             bzrlib.tests.branch_implementations,
             ]


=== modified file 'bzrlib/tests/blackbox/__init__.py'
--- bzrlib/tests/blackbox/__init__.py
+++ bzrlib/tests/blackbox/__init__.py
@@ -23,8 +23,8 @@
 rather starts again from the run_bzr function.
 """

-from bzrlib.tests import TestLoader
-from bzrlib.tests import TestCaseInTempDir, BzrTestBase
+from bzrlib.tests import (TestLoader, TestSuite, _load_module_by_name,
+                          TestCaseInTempDir, BzrTestBase)

 def test_suite():
     testmod_names = [
@@ -47,7 +47,13 @@
                      'bzrlib.tests.blackbox.test_upgrade',
                      'bzrlib.tests.blackbox.test_versioning',
                      ]
-    return TestLoader().loadTestsFromNames(testmod_names)
+
+    suite = TestSuite()
+    loader = TestLoader()
+    for mod_name in testmod_names:
+        mod = _load_module_by_name(mod_name)
+        suite.addTest(loader.loadTestsFromModule(mod))
+    return suite


 class ExternalBase(TestCaseInTempDir):



-------------- 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/20060204/e4422fa7/attachment.pgp 


More information about the bazaar mailing list