From a74636278353b829f3589f6e671f1d56172b291c Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 25 Sep 2012 14:23:53 -0400 Subject: testsuite: fix path in pylint tests --- testsuite/Testsrc/test_code_checks.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'testsuite/Testsrc') 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__), "..", -- cgit v1.2.3-1-g7c22