selftest: Allow passing arbitrary number of additional python path values.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 10 Nov 2011 19:24:17 +0000 (20:24 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 10 Nov 2011 22:37:04 +0000 (23:37 +0100)
selftest/selftesthelpers.py
source4/selftest/tests.py

index c0b5d0d46c86cdcccdcffe2565f0d17c07d77f64..c041c26f35ca7c637c2f313298fb69478e7df8c0 100644 (file)
@@ -158,13 +158,11 @@ def planperltestsuite(name, path):
         skiptestsuite(name, "Test::More not available")
 
 
-def planpythontestsuite(env, module, name=None, directory=None):
-    pypath = []
+def planpythontestsuite(env, module, name=None, extra_path=[]):
+    pypath = list(extra_path)
     if not has_system_subunit_run:
         pypath.extend(["%s/lib/subunit/python" % srcdir(),
             "%s/lib/testtools" % srcdir()])
-    if directory is not None:
-        pypath.append(directory)
     args = [python, "-m", "subunit.run", "$LISTOPT", module]
     if pypath:
         args.insert(0, "PYTHONPATH=%s" % ":".join(["$PYTHONPATH"] + pypath]))
index f2e7df4ed37afd139c848e514487c5b54f96bc8c..d25f0ddca827ac480a1a1f498c855c4d8d93b90a 100755 (executable)
@@ -395,7 +395,7 @@ def plansambapythontestsuite(name, env, path, module, environ={}, extra_args=[])
     args += extra_args
     plantestsuite(name, env, args)
 
-planpythontestsuite("api", "none", name="ldb.python", directory='lib/ldb/tests/python')
+planpythontestsuite("api", "none", name="ldb.python", extra_path=['lib/ldb/tests/python'])
 planpythontestsuite("none", "samba.tests.credentials")
 plantestsuite_idlist("samba.tests.gensec", "dc:local", [subunitrun, "$LISTOPT", '-U"$USERNAME%$PASSWORD"', "samba.tests.gensec"])
 planpythontestsuite("none", "samba.tests.registry")