Blackbox tests not being run

Robert Collins robertc at robertcollins.net
Sun Feb 5 23:24:51 GMT 2006


On Sat, 2006-02-04 at 18:01 -0600, John A Meinel wrote:
> 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):
> 
> 


Please do, I thought this was a snafu at my end when I hit this in
repository ...

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/20060206/6dc9c870/attachment.pgp 


More information about the bazaar mailing list