[MERGE] New test loader for selftest --load-list

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Apr 2 10:13:23 BST 2008


>>>>> "robert" == Robert Collins <robertc at robertcollins.net> writes:

    robert> On Tue, 2008-04-01 at 12:15 +0200, Vincent Ladeuil wrote:
    robert> bb:approve

    robert> The following method name is confusingly similar to the one it actually
    robert> calls with but with a different protocol. If you cant think of a
    robert> variation that is clearer, its ok.

Hmmm, so the remark in the doc string is not enough ?

Do you think 'load_plugin_tests' will do then ?

   Vincent

    >> === modified file 'bzrlib/plugin.py'
    >> --- bzrlib/plugin.py    2008-03-17 13:10:32 +0000
    >> +++ bzrlib/plugin.py    2008-03-26 11:29:40 +0000
    >> @@ -407,13 +407,28 @@
    >> else:
    >> return None
    >> 
    >> +    def load_tests(self, loader):
    >> +        """Return the adapted plugin's test suite.
    >> +
    >> +        :param loader: The custom loader that should be used to load additional
    >> +            tests.
    >> +
    >> +        Note that TestUtil.TestLoader defines load_tests(self, standard_tests,
    >> +        module, loader), but here we are handling the associated plugin module
    >> +        ourselves.
    >> +        """
    >> +        if getattr(self.module, 'load_tests', None) is not None:
    >> +            return loader.loadTestsFromModule(self.module)
    >> +        else:
    >> +            return None
    >> +



More information about the bazaar mailing list