summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-19 14:13:48 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-19 14:13:48 -0400
commita6126199c03919614f9f43afa57d4c19df06ffd6 (patch)
treea6e9e28ae26e720c7ee73ed02179ba3a46454552 /testsuite
parentdb29a7c5e8d8f4361d11df895ee5b34e2c21ae54 (diff)
downloadbcfg2-a6126199c03919614f9f43afa57d4c19df06ffd6.tar.gz
bcfg2-a6126199c03919614f9f43afa57d4c19df06ffd6.tar.bz2
bcfg2-a6126199c03919614f9f43afa57d4c19df06ffd6.zip
testsuite: fixed PYTHONPATH in pylint checks
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/Testsrc/test_code_checks.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/testsuite/Testsrc/test_code_checks.py b/testsuite/Testsrc/test_code_checks.py
index ded9cd8e3..3036397b6 100644
--- a/testsuite/Testsrc/test_code_checks.py
+++ b/testsuite/Testsrc/test_code_checks.py
@@ -159,12 +159,14 @@ class TestPylint(Bcfg2TestCase):
blacklist
def get_env(self):
- env = copy.copy(os.environ)
- if 'PYTHONPATH' in os.environ:
- env['PYTHONPATH'] = '%s:%s' % (env['PYTHONPATH'], testdir)
+ if ('PYTHONPATH' not in os.environ or
+ testdir not in os.environ['PYTHONPATH'].split(":")):
+ env = copy.copy(os.environ)
+ env['PYTHONPATH'] = ':'.join([env.get("PYTHONPATH", ""),
+ testdir])
+ return env
else:
- env['PYTHONPATH'] = testdir
- return env
+ return os.environ
@skipIf(not os.path.exists(srcpath), "%s does not exist" % srcpath)
@skipIf(not os.path.exists(rcfile), "%s does not exist" % rcfile)