Reduce number of places where sys.path is (possibly) updated for external module...
authorJelmer Vernooij <jelmer@samba.org>
Tue, 4 Nov 2014 20:37:41 +0000 (20:37 +0000)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 30 Nov 2014 19:54:03 +0000 (20:54 +0100)
Change-Id: I69d060f27ea090d14405e884d1ce271975358c56
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Sun Nov 30 20:54:04 CET 2014 on sn-devel-104

python/samba/tests/__init__.py
python/samba/tests/subunitrun.py
selftest/filter-subunit
selftest/format-subunit
source4/dsdb/tests/python/dsdb_schema_info.py
source4/torture/drs/python/drs_base.py

index 8d3b4dd152d16dc5330814a19b2ac1a66a6b2a25..8e662ed156425af69048d853776969e0222a8465 100644 (file)
@@ -26,6 +26,8 @@ from samba.samdb import SamDB
 import subprocess
 import tempfile
 
+samba.ensure_external_module("mimeparse", "mimeparse")
+samba.ensure_external_module("extras", "extras")
 samba.ensure_external_module("testtools", "testtools")
 
 # Other modules import these two classes from here, for convenience:
index d45467607e65b3910e873443b0478c46dd1964e5..291e7ab461abecf9b00053ce81da6e2569b0f0ec 100755 (executable)
@@ -37,9 +37,7 @@ signal.signal(signal.SIGINT, signal.SIG_DFL)
 import optparse
 import samba
 import sys
-samba.ensure_external_module("mimeparse", "mimeparse")
-samba.ensure_external_module("extras", "extras")
-samba.ensure_external_module("testtools", "testtools")
+import samba.tests
 samba.ensure_external_module("subunit", "subunit/python")
 import subunit.run
 
index 2ce9584c2a5305ac41f0807d3131215ce28da338..4f95546794a64a07cf78631fe6724757e7d78c20 100755 (executable)
 # to upstream subunit's filtering tools.
 
 import optparse
-import os
 import sys
 import signal
 
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/subunit/python"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/testtools"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/mimeparse"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/extras"))
+sys.path.insert(0, "bin/python")
+import samba
+samba.ensure_external_module("mimeparse", "mimeparse")
+samba.ensure_external_module("extras", "extras")
+samba.ensure_external_module("testtools", "testtools")
+samba.ensure_external_module("subunit", "subunit/python")
 
 import subunithelper
 
index f59de9725849fecc674a56a20163cc5e4be73bb5..58321bf368a3c4f2d80ab53973cedcfca770d28e 100755 (executable)
@@ -9,10 +9,12 @@ import os
 import signal
 import sys
 
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/subunit/python"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/testtools"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/mimeparse"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/extras"))
+sys.path.insert(0, "bin/python")
+import samba
+samba.ensure_external_module("mimeparse", "mimeparse")
+samba.ensure_external_module("extras", "extras")
+samba.ensure_external_module("testtools", "testtools")
+samba.ensure_external_module("subunit", "subunit/python")
 
 import subunithelper
 
index 28fce1b00f4a39d9a0890e42c75167b6f2656ac8..8f64f1063c07d4ba26ab3c516f8e06c635d60dfe 100755 (executable)
@@ -30,8 +30,7 @@ import time
 import random
 
 sys.path.insert(0, "bin/python")
-import samba
-samba.ensure_external_module("testtools", "testtools")
+import samba.tests
 
 from ldb import SCOPE_BASE, LdbError
 
index f692edc4f571d7b7179f1cde46b363edf06e23bd..683987fdb6d10085cddd9dd51db1059342ee0b72 100644 (file)
@@ -24,10 +24,8 @@ import time
 import os
 
 sys.path.insert(0, "bin/python")
-import samba
+import samba.tests
 from samba import dsdb
-samba.ensure_external_module("testtools", "testtools")
-samba.ensure_external_module("subunit", "subunit/python")
 
 from ldb import (
     SCOPE_BASE,
@@ -35,8 +33,6 @@ from ldb import (
     FLAG_MOD_REPLACE,
     )
 
-import samba.tests
-
 
 class DrsBaseTestCase(samba.tests.BlackboxTestCase):
     """Base class implementation for all DRS python tests.