Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/python_unittest.py

Issue 2010173003: Enable pylint warnings on presubmit checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update unit test, pylintrc, and remove unused argument lines. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/python_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/python_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/python_unittest.py
index 347174556a1bc59502d3a11d86af960306237222..0e272f657b7e148c900dc2656ef4411cd6c1d1f4 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/python_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/python_unittest.py
@@ -56,10 +56,18 @@ class PythonCheckerTest(unittest.TestCase):
file_path = os.path.join(current_dir, "python_unittest_input.py")
checker = PythonChecker(file_path, _mock_handle_style_error)
- checker.check(lines=[])
+ checker.check()
- self.assertEqual(errors, [
- (4, "pep8/W291", 5, "trailing whitespace"),
- (4, "pylint/E1601(print-statement)", 5, "[] print statement used"),
- (4, "pylint/E0602(undefined-variable)", 5, "[] Undefined variable 'error'"),
- ])
+ print errors
+
+ self.assertEqual(
+ [
+ (2, 'pep8/W291', 5, 'trailing whitespace'),
+ (3, 'pep8/E261', 5, 'at least two spaces before inline comment'),
+ (3, 'pep8/E262', 5, "inline comment should start with '# '"),
+ (2, 'pylint/C0303(trailing-whitespace)', 5, '[] Trailing whitespace'),
qyearsley 2016/05/29 21:00:33 Note that pylint and pep8 both print warnings abou
+ (2, 'pylint/E1601(print-statement)', 5, '[] print statement used'),
+ (2, 'pylint/E0602(undefined-variable)', 5, u"[] Undefined variable 'error'"),
+ (3, 'pylint/W0611(unused-import)', 5, '[] Unused import math'),
qyearsley 2016/05/29 21:00:33 After this CL, warnings about unused imports etc.
+ ],
+ errors)

Powered by Google App Engine
This is Rietveld 408576698