how to import my own plugin in a test?

Marius Kruger amanic at gmail.com
Sun May 2 17:49:10 BST 2010


hi,

On 2 May 2010 18:24, }--o <viktor.nagy at gmail.com> wrote:
...
> before running the tests I run
> $ export BZR_PLUGIN_PATH=/my/plugin/path
...
> is there some other "path" I should use to import my own plugin?

since 2.2.0b1: 2010-04-01 we have BZR_PLUGINS_AT

from `bzr help configuration`
BZR_PLUGINS_AT
~~~~~~~~~~~~~~

When adding a new feature or working on a bug in a plugin,
developers often need to use a specific version of a given
plugin. Since python requires that the directory containing the
code is named like the plugin itself this make it impossible to
use arbitrary directory names (using a two-level directory scheme
is inconvenient). ``BZR_PLUGINS_AT`` allows such directories even
if they don't appear in ``BZR_PLUGIN_PATH`` .

Plugins specified in this environment variable takes precedence
over the ones in ``BZR_PLUGIN_PATH``.

The variable specified a list of ``plugin_name at plugin path``,
``plugin_name`` being the name of the plugin as it appears in
python module paths, ``plugin_path`` being the path to the
directory containing the plugin code itself
(i.e. ``plugins/myplugin`` not ``plugins``).  Use ':' as the list
separator, use ';' on windows.
--
I think with that you should be able to do:
from bzrlib.plugins.commit_to_django import djangohandler

-- 
<>< Marius ><>



More information about the bazaar mailing list