summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/expression_command/call-function
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-11-03 02:06:18 +0000
committerZachary Turner <zturner@google.com>2015-11-03 02:06:18 +0000
commit95c453a221d5e757830145c2d5198c3a9da3f4b2 (patch)
treeaa824a74049518ed35ff67e2182f2dfcceac0658 /lldb/packages/Python/lldbsuite/test/expression_command/call-function
parent6f4ed269b9f4d8296f2002f5d96fcc5d8a9ef7b1 (diff)
downloadbcm5719-llvm-95c453a221d5e757830145c2d5198c3a9da3f4b2.tar.gz
bcm5719-llvm-95c453a221d5e757830145c2d5198c3a9da3f4b2.zip
Tighten up sys.path, and use absolute imports everywhere.
For convenience, we had added the folder that dotest.py was in to sys.path, so that we could easily write things like `import lldbutil` from anywhere and any test. This introduces a subtle problem when using Python's package system, because when unittest2 imports a particular test suite, the test suite is detached from the package. Thus, writing "import lldbutil" from dotest imports it as part of the package, and writing the same line from a test does a fresh import since the importing module was not part of the same package. The real way to fix this is to use absolute imports everywhere. Instead of writing "import lldbutil", we need to write "import lldbsuite.test.util". This patch fixes up that and all other similar cases, and additionally removes the script directory from sys.path to ensure that this can't happen again. llvm-svn: 251886
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/expression_command/call-function')
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py4
3 files changed, 6 insertions, 6 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
index 11caf627744..2ff0840c637 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
@@ -7,8 +7,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprCommandCallFunctionTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
index 1cd2d83373f..5832bf41785 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
@@ -7,8 +7,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprCommandCallStopContinueTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
index 3b101285750..700c22ca4b9 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
@@ -12,8 +12,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprCommandCallUserDefinedFunction(TestBase):
OpenPOWER on IntegriCloud