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

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: Remove print statement in test 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..8d2cba1b7932e11c6a411826f61a7bb122d281e3 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,16 @@ 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'"),
- ])
+ 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'),
+ (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'),
+ ],
+ errors)

Powered by Google App Engine
This is Rietveld 408576698