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 --- src/lib/Bcfg2/Server/Plugins/Probes.py | 2 +- testsuite/Testsrc/test_code_checks.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/Bcfg2/Server/Plugins/Probes.py b/src/lib/Bcfg2/Server/Plugins/Probes.py index 59e4edc73..e0f527f2c 100644 --- a/src/lib/Bcfg2/Server/Plugins/Probes.py +++ b/src/lib/Bcfg2/Server/Plugins/Probes.py @@ -73,7 +73,7 @@ class ProbeData(str): def __new__(cls, data): return str.__new__(cls, data) - def __init__(self, data): + def __init__(self, data): # pylint: disable=W0613 str.__init__(self) self._xdata = None self._json = None 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