summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-04-12 14:34:21 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-04-12 14:34:21 -0400
commit030fa036e592c3336da512a37945c3b0d0ac701e (patch)
treecafe1f354ef0fc6c1bfc6901f7574be3c4750fd9
parentc6933d0d26c8fb26fd26d6b4cf93204cdbb7ef3e (diff)
downloadpython-coveragepy-git-030fa036e592c3336da512a37945c3b0d0ac701e.tar.gz
Pylint tweaks
-rw-r--r--.pylintrc3
-rw-r--r--Makefile1
-rw-r--r--coverage/cmdline.py4
-rw-r--r--coverage/report.py4
-rw-r--r--test/test_execfile.py6
5 files changed, 13 insertions, 5 deletions
diff --git a/.pylintrc b/.pylintrc
index b8e6f22d..cbac7dfa 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -60,10 +60,11 @@ load-plugins=
# C0323:311:coverage.report: Operator not followed by a space
# Messages that may be silly:
# R0201: 42:Tracer.stop: Method could be a function
+# E1103: 26:RunTests.test_run_python_file: Instance of 'file' has no 'getvalue' member (but some types could not be inferred)
# Messages that are noisy for now, eventually maybe we'll turn them on:
# C0111:169:coverage.analyze_morf: Missing docstring
# C0103:256:coverage.morf_filename: Invalid name "f" (should match [a-z_][a-z0-9_]{2,30}$)
-disable-msg=I0011,W0603,W0142,C0323, R0201, C0111,C0103
+disable-msg=I0011,W0603,W0142,C0323, R0201,E1103, C0111,C0103
[REPORTS]
diff --git a/Makefile b/Makefile
index 77b7d607..d3cc0830 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,7 @@ clean:
lint: clean
python -x /Python25/Scripts/pylint.bat --rcfile=.pylintrc coverage
+ python -x /Python25/Scripts/pylint.bat --rcfile=.pylintrc test/test_execfile.py
python -x /Python25/Scripts/pylint.bat --rcfile=.pylintrc test/test_farm.py
python /Python25/Lib/tabnanny.py coverage
python checkeol.py
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index df508cf8..dfcd3436 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -146,7 +146,9 @@ class CoverageScript:
omit = omit.split(',')
if settings.get('report'):
- reporter = SummaryReporter(self.coverage, show_missing, ignore_errors)
+ reporter = SummaryReporter(
+ self.coverage, show_missing, ignore_errors
+ )
reporter.report(args, omit_prefixes=omit)
if settings.get('annotate'):
reporter = AnnotateReporter(self.coverage, ignore_errors)
diff --git a/coverage/report.py b/coverage/report.py
index f20b4539..9859eb96 100644
--- a/coverage/report.py
+++ b/coverage/report.py
@@ -26,5 +26,7 @@ class Reporter(object):
"""
morfs = morfs or self.coverage.data.executed_files()
- self.code_units = code_unit_factory(morfs, self.coverage.file_locator, omit_prefixes)
+ self.code_units = code_unit_factory(
+ morfs, self.coverage.file_locator, omit_prefixes
+ )
self.code_units.sort()
diff --git a/test/test_execfile.py b/test/test_execfile.py
index 6ad2f58e..d75bde0a 100644
--- a/test/test_execfile.py
+++ b/test/test_execfile.py
@@ -24,12 +24,14 @@ class RunTests(unittest.TestCase):
tryfile = os.path.join(here, "try_execfile.py")
run_python_file(tryfile, [tryfile, "arg1", "arg2"])
mod_globs = eval(self.stdout.getvalue())
-
+
# The file should think it is __main__
self.assertEqual(mod_globs['__name__'], "__main__")
# It should seem to come from a file named try_execfile
- dunder_file = os.path.splitext(os.path.basename(mod_globs['__file__']))[0]
+ dunder_file = os.path.splitext(
+ os.path.basename(mod_globs['__file__'])
+ )[0]
self.assertEqual(dunder_file, "try_execfile")
# It should have its correct module data.