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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/run_tests.py

Issue 10984018: [chrome_remote_control] Add pylint to PRESUMMIT and fix lint (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for landing Created 8 years, 3 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: tools/chrome_remote_control/chrome_remote_control/run_tests.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/run_tests.py b/tools/chrome_remote_control/chrome_remote_control/run_tests.py
index f3c0a0345dee9d1f5dca6dcbc385d1d50df9f82f..aa9e492fa242cf1fc7f91fa176de5eae0ed57e63 100644
--- a/tools/chrome_remote_control/chrome_remote_control/run_tests.py
+++ b/tools/chrome_remote_control/chrome_remote_control/run_tests.py
@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import fnmatch
-import functools
import logging
import os
import traceback
@@ -18,9 +17,10 @@ def RequiresBrowserOfType(*types):
def Discover(start_dir, pattern = 'test*.py', top_level_dir = None):
if hasattr(unittest.defaultTestLoader, 'discover'):
- return unittest.defaultTestLoader.discover(start_dir,
- pattern,
- top_level_dir)
+ return unittest.defaultTestLoader.discover( # pylint: disable=E1101
+ start_dir,
+ pattern,
+ top_level_dir)
modules = []
for dirpath, _, filenames in os.walk(start_dir):
@@ -41,7 +41,7 @@ def Discover(start_dir, pattern = 'test*.py', top_level_dir = None):
# load the module
try:
module = __import__(fqn, fromlist=[True])
- except:
+ except Exception:
print 'While importing [%s]\n' % fqn
traceback.print_exc()
continue
@@ -88,9 +88,9 @@ def DiscoverAndRunTests(dir_name, args, top_level_dir):
return False
if hasattr(test, '_testMethodName'):
- method = getattr(test, test._testMethodName)
+ method = getattr(test, test._testMethodName) # pylint: disable=W0212
if hasattr(method, '_requires_browser_types'):
- types = method._requires_browser_types
+ types = method._requires_browser_types # pylint: disable=W0212
if browser_options.browser_type_for_unittests not in types:
logging.debug('Skipping test %s because it requires %s' %
(test.id(), types))
@@ -129,7 +129,8 @@ def Main(args, start_dir, top_level_dir):
num_errors = 0
try:
os.chdir(top_level_dir)
- for _ in range(default_options.run_test_repeat_count):
+ for _ in range(
+ default_options.run_test_repeat_count): # pylint: disable=E1101
num_errors += DiscoverAndRunTests(start_dir, args, top_level_dir)
finally:
os.chdir(olddir)

Powered by Google App Engine
This is Rietveld 408576698