Use samba.subunit.run to run subunit tests.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 11 Dec 2014 01:16:38 +0000 (01:16 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 6 Mar 2015 03:41:46 +0000 (04:41 +0100)
Change-Id: Id9bdd33b7ac5e4db40ab8bef4dbe0f04c36d8da7
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/selftesthelpers.py

index 6e387ec9dd3e6917b6d4b2b0fdbe5bcdf0866c6b..3c1e6badef32bce765dd1b5c83d1bc9c6c98f49c 100644 (file)
@@ -58,13 +58,6 @@ if subprocess.call(perl + ["-e", "eval require Test::More;"]) == 0:
 else:
     has_perl_test_more = False
 
-try:
-    from subunit.run import TestProgram
-except ImportError:
-    has_system_subunit_run = False
-else:
-    has_system_subunit_run = True
-
 python = os.getenv("PYTHON", "python")
 
 # Set a default value, overridden if we find a working one on the system
@@ -166,13 +159,7 @@ def planpythontestsuite(env, module, name=None, extra_path=[]):
     if name is None:
         name = module
     pypath = list(extra_path)
-    if not has_system_subunit_run:
-        pypath.extend([
-            "%s/lib/subunit/python" % srcdir(),
-            "%s/lib/testtools" % srcdir(),
-            "%s/lib/extras" % srcdir(),
-            "%s/lib/mimeparse" % srcdir()])
-    args = [python, "-m", "subunit.run", "$LISTOPT", "$LOADLIST", module]
+    args = [python, "-m", "samba.subunit.run", "$LISTOPT", "$LOADLIST", module]
     if pypath:
         args.insert(0, "PYTHONPATH=%s" % ":".join(["$PYTHONPATH"] + pypath))
     plantestsuite_loadlist(name, env, args)