[py-dev] virtual namespace for plugins
Frederik Dohr
fdg001 at gmx.net
Thu Nov 12 19:23:43 CET 2009
> To make Python aware of the local package (e.g. for running tests out of
> the repository), something like the following is required in a
> root-level __init__.py:
> path = os.path.abspath(VIRTUAL_NAMESPACE)
> sys.modules[VIRTUAL_NAMESPACE].__dict__["__path__"].insert(0, path)
It appears my testing was flawed; this __init__.py is not being picked
up automatically after all (which seemed odd in the first place), at
least not by setup.py.
So an explicit "import __init__" is required - in which case that module
should be renamed, of course.
-- F.
More information about the Pytest-dev
mailing list