Unittest import error
jelmer at vernstok.nl
Wed May 12 09:21:23 MDT 2010
On Wed, 2010-05-12 at 16:15 +0300, Zahari Zahariev wrote:
> I wanted to start some manual unittest files and I bumped into an
> root at darkstar:~/samba-master/source4# python
> lib/ldb/tests/python/ldap.py localhost -U%
> Traceback (most recent call last):
> File "lib/ldb/tests/python/ldap.py", line 31, in <module>
> from subunit.run import SubunitTestRunner
> ImportError: No module named subunit.run
> Can you tell why does this happen?
You should either have subunit installed on your system or you need to
pull in the version that is included with Samba somehow. The latter is
probably not desirable since that file lives in the ldb directory and we
do want ldb to be installable standalone.
So you could either add an attempt to import 'samba' and a call to
ensure_external() in that file (but allowing that to fail, as the samba
module might not be available), or you could install subunit on your
system or you could set PYTHONPATH to a path that includes the subunit
that is included with Samba (../lib/subunit/python IIRC).
More information about the samba-technical