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 15:49:25 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-25 15:49:25 -0400
commit3b3ecb4fcba471d33dbd118c02798e6f3f4b9927 (patch)
treeaf85e3850935cd9e076d4e0da29f287fa9dcaefe /testsuite/Testsrc/test_code_checks.py
parenta74636278353b829f3589f6e671f1d56172b291c (diff)
downloadbcfg2-3b3ecb4fcba471d33dbd118c02798e6f3f4b9927.tar.gz
bcfg2-3b3ecb4fcba471d33dbd118c02798e6f3f4b9927.tar.bz2
bcfg2-3b3ecb4fcba471d33dbd118c02798e6f3f4b9927.zip
various pylint fixes
Diffstat (limited to 'testsuite/Testsrc/test_code_checks.py')
-rw-r--r--testsuite/Testsrc/test_code_checks.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/testsuite/Testsrc/test_code_checks.py b/testsuite/Testsrc/test_code_checks.py
index d4a82eab4..fbca427f7 100644
--- a/testsuite/Testsrc/test_code_checks.py
+++ b/testsuite/Testsrc/test_code_checks.py
@@ -24,14 +24,6 @@ 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__), "..",
@@ -74,7 +66,6 @@ error_checks = {
"lib/Bcfg2/Server/Plugins": ["Decisions.py",
"Deps.py",
"Ldap.py",
- "NagiosGen.py",
"Pkgmgr.py",
"SSHbase.py",
"SSLCA.py"]
@@ -122,10 +113,21 @@ class TestPylint(Bcfg2TestCase):
@skipIf(not os.path.exists(rcfile), "%s does not exist" % rcfile)
@skipUnless(HAS_PYLINT, "pylint not found, skipping")
def test_lib_full(self):
- full_list = list(set(self._get_paths(full_checks)) -
- set(expand_path_dict(error_checks)))
+ full_list = list((set(self._get_paths(full_checks)) -
+ set(expand_path_dict(error_checks))) -
+ set(expand_path_dict(django_checks)))
self._pylint_full(full_list)
+ @skipUnless(HAS_DJANGO, "Django not found, skipping")
+ @skipIf(not os.path.exists(srcpath), "%s does not exist" % srcpath)
+ @skipIf(not os.path.exists(rcfile), "%s does not exist" % rcfile)
+ @skipUnless(HAS_PYLINT, "pylint not found, skipping")
+ def test_django_full(self):
+ test_list = list(set(self._get_paths(full_checks)) &
+ set(expand_path_dict(django_checks)))
+ return self._pylint_errors(test_list,
+ extra_args=["-d", "E1101"])
+
@skipIf(not os.path.exists(srcpath), "%s does not exist" % srcpath)
@skipIf(not os.path.exists(rcfile), "%s does not exist" % rcfile)
@skipUnless(HAS_PYLINT, "pylint not found, skipping")
@@ -182,7 +184,6 @@ class TestPylint(Bcfg2TestCase):
rv = pylint.wait()
for line in output.splitlines():
- #print line
if self.error_re.search(line):
print(line)
# pylint returns a bitmask, where 1 means fatal errors