summaryrefslogtreecommitdiffstats
path: root/testsuite
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
parenta74636278353b829f3589f6e671f1d56172b291c (diff)
downloadbcfg2-3b3ecb4fcba471d33dbd118c02798e6f3f4b9927.tar.gz
bcfg2-3b3ecb4fcba471d33dbd118c02798e6f3f4b9927.tar.bz2
bcfg2-3b3ecb4fcba471d33dbd118c02798e6f3f4b9927.zip
various pylint fixes
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/Testsrc/test_code_checks.py25
-rw-r--r--testsuite/pylintrc.conf4
-rw-r--r--testsuite/requirements.txt1
3 files changed, 16 insertions, 14 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
diff --git a/testsuite/pylintrc.conf b/testsuite/pylintrc.conf
index 2e4279e75..250929163 100644
--- a/testsuite/pylintrc.conf
+++ b/testsuite/pylintrc.conf
@@ -33,7 +33,7 @@ load-plugins=
# can either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once).
-disable=W0142,W0511,W0603,W1201,R0201,R0901,R0902,R0903,R0904,R0921,R0922,C0302,I0011
+disable=F0401,W0142,W0511,W0603,W1201,R0201,R0901,R0902,R0903,R0904,R0921,R0922,C0302,I0011
[REPORTS]
@@ -121,7 +121,7 @@ zope=no
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
-generated-members=objects,DoesNotExist,isoformat
+generated-members=objects,DoesNotExist,isoformat,filter,save,count,get,add,id
[MISCELLANEOUS]
diff --git a/testsuite/requirements.txt b/testsuite/requirements.txt
index 39418e98b..8529b247f 100644
--- a/testsuite/requirements.txt
+++ b/testsuite/requirements.txt
@@ -2,3 +2,4 @@ lxml
nose
mock
sphinx
+daemon