running 'bzr selftest' on windows

Vincent Ladeuil v.ladeuil+lp at free.fr
Sat Feb 27 22:47:22 GMT 2010


>>>>> "Jelmer" == Jelmer Vernooij <jelmer at samba.org> writes:

<snip/>

    >> So you can do:
    >> 
    >> bzrlib.tests.test_prefix_alias_registry.register('grep', 'bzrlib.plugins.grep')
    >> 
    >> And use:
    >> 
    >> bzr selftest -s grep
    >> 
    >> To avoid excessive pollution of the name space, you may do that in
    >> an another dedicated plugin though.

    Jelmer> Is there some way to do this without forcing the
    Jelmer> import of bzrlib.tests in the plugins' __init__?

No way that I can think of with the actual implementation.

The registry is in bzrlib/tests/__init__.py (as in the selftest
command that uses it) and then of course you need it to update
it.

Since this is used to avoid loading some test modules, this needs
to be defined outside of these modules too.

    Jelmer> I'm quite keen on using these shortcuts, but I'd
    Jelmer> rather not slow down the plugins.

That's a valid concern.

I think the most obvious solution is to move this registry
outside of bzrlib.tests.

Another solution will be to define a hook at the beginning of
selftest so the import can be delayed until selftest is called.

The later may be simpler to implement.

           Vincent




More information about the bazaar mailing list