summaryrefslogtreecommitdiffstats
path: root/testsuite/Testsrc/test_code_checks.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-25 14:23:53 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-25 14:23:53 -0400
commita74636278353b829f3589f6e671f1d56172b291c (patch)
tree32bd9114938bca7cdaf6bf799309d79531c04a1b /testsuite/Testsrc/test_code_checks.py
parent4096811a53b8ee44b1382897065bcd99a80ab1c0 (diff)
downloadbcfg2-a74636278353b829f3589f6e671f1d56172b291c.tar.gz
bcfg2-a74636278353b829f3589f6e671f1d56172b291c.tar.bz2
bcfg2-a74636278353b829f3589f6e671f1d56172b291c.zip
testsuite: fix path in pylint tests
Diffstat (limited to 'testsuite/Testsrc/test_code_checks.py')
-rw-r--r--testsuite/Testsrc/test_code_checks.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/Testsrc/test_code_checks.py b/testsuite/Testsrc/test_code_checks.py
index 58785028d..d4a82eab4 100644
--- a/testsuite/Testsrc/test_code_checks.py
+++ b/testsuite/Testsrc/test_code_checks.py
@@ -24,6 +24,14 @@ except ImportError:
# path to Bcfg2 src directory
srcpath = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..",
"src"))
+# we set this in the environment rather than with sys.path because we
+# call pylint, an external command, later, and it needs the modified
+# environment
+if 'PYTHONPATH' in os.environ:
+ os.environ['PYTHONPATH'] = os.environ['PYTHONPATH'] + ":" + \
+ os.path.join(srcpath, "lib")
+else:
+ os.environ['PYTHONPATH'] = os.path.join(srcpath, "lib")
# path to pylint rc file
rcfile = os.path.abspath(os.path.join(os.path.dirname(__file__), "..",