summaryrefslogtreecommitdiff
path: root/unittest_suite.py
diff options
context:
space:
mode:
authormbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2008-05-21 18:19:38 +0000
committermbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2008-05-21 18:19:38 +0000
commit689852c7ab90efd7d83201bcd8f008a77de34bf7 (patch)
tree3cb08ac74d0ce14bffec2bf56fb61fe4ba4f2337 /unittest_suite.py
parent2e6850d2ac8f362e605542cc2dabbe699bea4b3e (diff)
Diff for unittest_suite.py to make it work consistently for global imports.
From: travis miller git-svn-id: svn://test.kernel.org/autotest/trunk@1537 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'unittest_suite.py')
-rw-r--r--unittest_suite.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/unittest_suite.py b/unittest_suite.py
index b8794ca5..4aab623c 100644
--- a/unittest_suite.py
+++ b/unittest_suite.py
@@ -4,8 +4,9 @@ import os, sys
import unittest
# ensure the root is where it should be
-root = os.path.dirname(__file__)
-sys.path.append(root)
+root = os.path.abspath(os.path.dirname(__file__))
+from client import setup_modules
+setup_modules.setup(base_path=root, root_module_name="autotest_lib")
suites = []
@@ -14,7 +15,8 @@ def lister(dummy, dirname, files):
for f in files:
if f.endswith('_unittest.py'):
temp = os.path.join(dirname, f).strip('.py')
- mod = temp[1:].replace('/', '.')
+ mod = ('autotest_lib'
+ + temp[len(root):].replace('/', '.'))
suite = loader.loadTestsFromName(mod)
suites.append(suite)